Skip to content

Commit 3c55387

Browse files
authored
test: make sure we don't drop tempdirs early (#373)
1 parent 17bf644 commit 3c55387

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/namedtempfile.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,10 @@ fn test_change_dir() {
332332
let path = std::env::current_dir().unwrap().join(tmpfile.path());
333333
std::env::set_current_dir(&dir_b).expect("failed to change to directory B");
334334
drop(tmpfile);
335-
assert!(!exists(path))
335+
assert!(!exists(path));
336+
337+
drop(dir_a);
338+
drop(dir_b);
336339
}
337340

338341
#[test]
@@ -347,7 +350,10 @@ fn test_change_dir_make() {
347350
let path = std::env::current_dir().unwrap().join(tmpfile.path());
348351
std::env::set_current_dir(&dir_b).expect("failed to change to directory B");
349352
drop(tmpfile);
350-
assert!(!exists(path))
353+
assert!(!exists(path));
354+
355+
drop(dir_a);
356+
drop(dir_b);
351357
}
352358

353359
#[test]

0 commit comments

Comments
 (0)