Skip to content

Commit

Permalink
fixup: debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Sep 2, 2024
1 parent 5a9cdd4 commit a97c250
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions tests/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,31 +552,40 @@ async fn extracting_malicious_tarball() {
// The `tmp` subdirectory should be created and within this
// subdirectory, there should be files named `abs_evil.txt` through
// `abs_evil6.txt`.
assert!(fs::metadata(td.path().join("tmp"))
let tmp_root = td.path().join("tmp");

assert!(fs::metadata(&tmp_root)
.await
.map(|m| m.is_dir())
.unwrap_or(false));
assert!(fs::metadata(td.path().join("tmp/abs_evil.txt"))

let mut entries = fs::read_dir(&tmp_root).await.unwrap();
while let Some(entry) = entries.next().await {
let entry = entry.unwrap();
println!("- {:?}", entry.file_name());
}

assert!(fs::metadata(tmp_root.join("abs_evil.txt"))
.await
.map(|m| m.is_file())
.unwrap_or(false));
assert!(fs::metadata(td.path().join("tmp/abs_evil2.txt"))
assert!(fs::metadata(tmp_root.join("abs_evil2.txt"))
.await
.map(|m| m.is_file())
.unwrap_or(false));
assert!(fs::metadata(td.path().join("tmp/abs_evil3.txt"))
assert!(fs::metadata(tmp_root.join("abs_evil3.txt"))
.await
.map(|m| m.is_file())
.unwrap_or(false));
assert!(fs::metadata(td.path().join("tmp/abs_evil4.txt"))
assert!(fs::metadata(tmp_root.join("abs_evil4.txt"))
.await
.map(|m| m.is_file())
.unwrap_or(false));
assert!(fs::metadata(td.path().join("tmp/abs_evil5.txt"))
assert!(fs::metadata(tmp_root.join("abs_evil5.txt"))
.await
.map(|m| m.is_file())
.unwrap_or(false));
assert!(fs::metadata(td.path().join("tmp/abs_evil6.txt"))
assert!(fs::metadata(tmp_root.join("abs_evil6.txt"))
.await
.map(|m| m.is_file())
.unwrap_or(false));
Expand Down

0 comments on commit a97c250

Please sign in to comment.