Skip to content

Commit

Permalink
feat: Add test for multiple include filters
Browse files Browse the repository at this point in the history
  • Loading branch information
woelper committed Jul 22, 2024
1 parent 219269a commit e9dbd7f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,19 @@ fn copy_include() {
create_dir_all(src).unwrap();
File::create(format!("{}/foo", src)).unwrap();
File::create(format!("{}/bar", src)).unwrap();
File::create(format!("{}/baz", src)).unwrap();

CopyBuilder::new(src, dst)
.overwrite(true)
.overwrite_if_newer(true)
.with_include_filter("foo")
.with_include_filter("baz")
.run()
.unwrap();

assert!(Path::new(&format!("{}/foo", dst)).is_file());
assert!(!Path::new(&format!("{}/bar", dst)).is_file());
assert!(!Path::new(&format!("{}/bar", dst)).exists());
assert!(Path::new(&format!("{}/baz", dst)).exists());

// clean up
std::fs::remove_dir_all(src).unwrap();
Expand Down

0 comments on commit e9dbd7f

Please sign in to comment.