diff options
author | Andrew Gallant <jamslam@gmail.com> | 2016-09-24 19:23:19 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2016-09-24 19:24:24 -0400 |
commit | a6e3cab65a4e0b8dc14473eb83b10eaff2e7848d (patch) | |
tree | 236f764cb1a157fa6a698b3c7dec6a1878b66e2f /tests | |
parent | 7b860affbeb015aa0298a95b1e23eb8db7d181cc (diff) |
Add --no-filename flag.
When this flag is set, a filename is never shown for a match.
Closes #20
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tests.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs index bd85fb19..4ffda0d6 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -652,6 +652,18 @@ clean!(regression_65, "xyz", ".", |wd: WorkDir, mut cmd: Command| { wd.assert_err(&mut cmd); }); +// See: https://github.com/BurntSushi/ripgrep/issues/20 +sherlock!(feature_20, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| { + cmd.arg("--no-filename"); + + let lines: String = wd.stdout(&mut cmd); + let expected = "\ +For the Doctor Watsons of this world, as opposed to the Sherlock +be, to a very large extent, the result of luck. Sherlock Holmes +"; + assert_eq!(lines, expected); +}); + #[test] fn binary_nosearch() { let wd = WorkDir::new("binary_nosearch"); |