diff options
author | Daniel Luz <dev@mernen.com> | 2016-11-19 21:48:59 -0200 |
---|---|---|
committer | Daniel Luz <dev@mernen.com> | 2016-11-19 21:48:59 -0200 |
commit | bd3e7eedb1d8698a46e18afd2041e675f6597947 (patch) | |
tree | 327d6c6f2f30174ae754232480bc656ac5713105 /tests | |
parent | 1e6c2ac8e374c9f45204ecce1ddd96842ed26d15 (diff) |
Add --files-without-matches flag.
Performs the opposite of --files-with-matches: only shows paths of
files that contain zero matches.
Closes #138
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tests.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs index bdafb298..66c2e51c 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -339,6 +339,14 @@ sherlock!(files_with_matches, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| { assert_eq!(lines, expected); }); +sherlock!(files_without_matches, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| { + wd.create("file.py", "foo"); + cmd.arg("--files-without-matches"); + let lines: String = wd.stdout(&mut cmd); + let expected = "file.py\n"; + assert_eq!(lines, expected); +}); + sherlock!(after_context, |wd: WorkDir, mut cmd: Command| { cmd.arg("-A").arg("1"); let lines: String = wd.stdout(&mut cmd); @@ -1059,6 +1067,16 @@ sherlock!(feature_89_files_with_matches, "Sherlock", ".", }); // See: https://github.com/BurntSushi/ripgrep/issues/89 +sherlock!(feature_89_files_without_matches, "Sherlock", ".", +|wd: WorkDir, mut cmd: Command| { + wd.create("file.py", "foo"); + cmd.arg("--null").arg("--files-without-matches"); + + let lines: String = wd.stdout(&mut cmd); + assert_eq!(lines, "file.py\x00"); +}); + +// See: https://github.com/BurntSushi/ripgrep/issues/89 sherlock!(feature_89_count, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| { cmd.arg("--null").arg("--count"); |