Skip to content

Commit

Permalink
tests: show that hidden files are not picked up by difftastic
Browse files Browse the repository at this point in the history
  • Loading branch information
poliorcetics authored and Wilfred committed Apr 1, 2024
1 parent 3b049c2 commit 1f79d16
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions sample_files/hidden-after/.hidden.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
after
1 change: 1 addition & 0 deletions sample_files/hidden-after/.hidden/doc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
after
1 change: 1 addition & 0 deletions sample_files/hidden-before/.hidden.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
before
1 change: 1 addition & 0 deletions sample_files/hidden-before/.hidden/doc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
before
13 changes: 13 additions & 0 deletions tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,16 @@ fn dump_syntax() {
.arg("sample_files/simple_after.js");
cmd.assert().success();
}

#[test]
fn walk_hidden_items() {
let mut cmd = get_base_command();

cmd.args(["sample_files/hidden-before", "sample_files/hidden-after"]);

let predicate_fn = predicate::str::contains(".hidden/doc.txt")
.and(predicate::str::contains(".hidden.txt"))
.and(predicate::str::contains("before"))
.and(predicate::str::contains("after"));
cmd.assert().stdout(predicate_fn);
}

0 comments on commit 1f79d16

Please sign in to comment.