summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2016-09-26 19:09:59 -0400
committerAndrew Gallant <jamslam@gmail.com>2016-09-26 19:09:59 -0400
commitd30640344090fc3ffde6d58e0c5a4c928fb00990 (patch)
treef8eec34487f9345b457e1d7717cebae6a662ec41 /tests
parentebabe1df6a5922e88aad9024661aaf3a456200b1 (diff)
Fix an off-by-one error with --column.
Fixes #105.
Diffstat (limited to 'tests')
-rw-r--r--tests/tests.rs22
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/tests.rs b/tests/tests.rs
index 3ae568e7..582eb841 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -86,8 +86,8 @@ sherlock!(columns, |wd: WorkDir, mut cmd: Command| {
cmd.arg("--column");
let lines: String = wd.stdout(&mut cmd);
let expected = "\
-58:For the Doctor Watsons of this world, as opposed to the Sherlock
-50:be, to a very large extent, the result of luck. Sherlock Holmes
+57:For the Doctor Watsons of this world, as opposed to the Sherlock
+49:be, to a very large extent, the result of luck. Sherlock Holmes
";
assert_eq!(lines, expected);
});
@@ -716,6 +716,24 @@ clean!(regression_93, r"(\d{1,3}\.){3}\d{1,3}", ".",
assert_eq!(lines, "foo:192.168.1.1\n");
});
+// See: https://github.com/BurntSushi/ripgrep/issues/105
+clean!(regression_105_part1, "test", ".", |wd: WorkDir, mut cmd: Command| {
+ wd.create("foo", "zztest");
+ cmd.arg("--vimgrep");
+
+ let lines: String = wd.stdout(&mut cmd);
+ assert_eq!(lines, "foo:1:3:zztest\n");
+});
+
+// See: https://github.com/BurntSushi/ripgrep/issues/105
+clean!(regression_105_part2, "test", ".", |wd: WorkDir, mut cmd: Command| {
+ wd.create("foo", "zztest");
+ cmd.arg("--column");
+
+ let lines: String = wd.stdout(&mut cmd);
+ assert_eq!(lines, "foo:3:zztest\n");
+});
+
// See: https://github.com/BurntSushi/ripgrep/issues/20
sherlock!(feature_20, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
cmd.arg("--no-filename");