Skip to content

Commit 8301f79

Browse files
committed
Better comments
1 parent 51d8f4d commit 8301f79

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/test_unistd.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ use tempfile::tempfile;
1515
use tempdir::TempDir;
1616
use libc::off_t;
1717

18+
/// Run a test in a subprocess
19+
///
20+
/// This is useful for tests that change a process-level property, like the cwd
21+
/// or a signal handler.
22+
///
23+
/// # Arguments
24+
///
25+
/// * `func` - function to run in the subprocess. It should exit 0 on success
26+
/// or nonzero on failure. The usual `assert` functions will do the right
27+
/// thing.
1828
fn test_in_subprocess<F: Fn()>(func: F) {
1929
let pid = fork();
2030
match pid {
@@ -190,7 +200,6 @@ fn test_getcwd() {
190200
let mut inner_tmp_dir = tmp_dir.path().to_path_buf();
191201
for _ in 0..5 {
192202
let newdir = iter::repeat("a").take(100).collect::<String>();
193-
//inner_tmp_dir = inner_tmp_dir.join(newdir).path();
194203
inner_tmp_dir.push(newdir);
195204
assert!(mkdir(inner_tmp_dir.as_path(), stat::S_IRWXU).is_ok());
196205
}

0 commit comments

Comments
 (0)