Skip to content

Commit

Permalink
Fix confusion between empty/nonempty test.
Browse files Browse the repository at this point in the history
The single_empty_file test was writing random content to the file,
whereas the single_file test was writing an empty file.
Only the latter tested different levels, so I figured that test
was the one that should be using actual file content.
  • Loading branch information
rcorre authored and marcospb19 committed Jul 14, 2024
1 parent b7ebcd3 commit 4a323ae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ fn single_empty_file(ext: Extension, #[any(size_range(0..8).lift())] exts: Vec<F
let before_file = &before.join("file");
let archive = &dir.join(format!("file.{}", merge_extensions(ext, exts)));
let after = &dir.join("after");
write_random_content(
&mut fs::File::create(before_file).unwrap(),
&mut SmallRng::from_entropy(),
);
fs::write(before_file, []).unwrap();
ouch!("-A", "c", before_file, archive);
ouch!("-A", "d", archive, "-d", after);
assert_same_directory(before, after, false);
Expand All @@ -118,7 +115,10 @@ fn single_file(
let before_file = &before.join("file");
let archive = &dir.join(format!("file.{}", merge_extensions(ext, exts)));
let after = &dir.join("after");
fs::write(before_file, []).unwrap();
write_random_content(
&mut fs::File::create(before_file).unwrap(),
&mut SmallRng::from_entropy(),
);
if let Some(level) = level {
ouch!("-A", "c", "-l", level.to_string(), before_file, archive);
} else {
Expand Down

0 comments on commit 4a323ae

Please sign in to comment.