diff options
author | Andrew Gallant <jamslam@gmail.com> | 2018-04-23 19:25:55 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2018-04-23 19:26:58 -0400 |
commit | b75526bd7f92529c8e49c9795d3c0e6bc4143721 (patch) | |
tree | 33a801e2a934eb6f7ae8478357a2efb86b4aa66c /tests | |
parent | 507801c1f2efdc45ea25227a613c2e38cdecf88b (diff) |
output: add --no-column flag
This disables columns in the output if they were otherwise enabled.
Fixes #880
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tests.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs index cab1f42d..c9fa002f 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -836,6 +836,34 @@ sherlock:5:12:but Doctor Watson has to have it taken out for him and dusted, assert_eq!(lines, expected); }); +sherlock!(vimgrep_no_line, "Sherlock|Watson", ".", +|wd: WorkDir, mut cmd: Command| { + cmd.arg("--vimgrep").arg("-N"); + + let lines: String = wd.stdout(&mut cmd); + let expected = "\ +sherlock:16:For the Doctor Watsons of this world, as opposed to the Sherlock +sherlock:57:For the Doctor Watsons of this world, as opposed to the Sherlock +sherlock:49:be, to a very large extent, the result of luck. Sherlock Holmes +sherlock:12:but Doctor Watson has to have it taken out for him and dusted, +"; + assert_eq!(lines, expected); +}); + +sherlock!(vimgrep_no_line_no_column, "Sherlock|Watson", ".", +|wd: WorkDir, mut cmd: Command| { + cmd.arg("--vimgrep").arg("-N").arg("--no-column"); + + let lines: String = wd.stdout(&mut cmd); + let expected = "\ +sherlock:For the Doctor Watsons of this world, as opposed to the Sherlock +sherlock:For the Doctor Watsons of this world, as opposed to the Sherlock +sherlock:be, to a very large extent, the result of luck. Sherlock Holmes +sherlock:but Doctor Watson has to have it taken out for him and dusted, +"; + assert_eq!(lines, expected); +}); + // See: https://github.com/BurntSushi/ripgrep/issues/16 clean!(regression_16, "xyz", ".", |wd: WorkDir, mut cmd: Command| { wd.create(".gitignore", "ghi/"); |