summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordana <dana@dana.is>2017-11-27 12:50:24 -0600
committerAndrew Gallant <jamslam@gmail.com>2017-11-29 12:55:42 -0500
commitd73a75d6cd82068252c35c5718900b6a1acb296e (patch)
tree7672d81e02a9e8d3e742cbeda133223594b1bf26 /tests
parent7ae1f373c2b899c7db5f8106dec4d7423b1d8364 (diff)
Omit context separators when using a contextless option like -c or -l
Fixes #693
Diffstat (limited to 'tests')
-rw-r--r--tests/tests.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs
index 2549ef27..395514b2 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -1799,6 +1799,25 @@ fn regression_568_leading_hyphen_option_arguments() {
assert_eq!(lines, "foo -n -baz\n");
}
+// See: https://github.com/BurntSushi/ripgrep/issues/693
+#[test]
+fn regression_693_context_option_in_contextless_mode() {
+ let wd = WorkDir::new("regression_693_context_option_in_contextless_mode");
+
+ wd.create("foo", "xyz\n");
+ wd.create("bar", "xyz\n");
+
+ let mut cmd = wd.command();
+ cmd.arg("-C1").arg("-c").arg("--sort-files").arg("xyz");
+
+ let lines: String = wd.stdout(&mut cmd);
+ let expected = "\
+bar:1
+foo:1
+";
+ assert_eq!(lines, expected);
+}
+
#[test]
fn type_list() {
let wd = WorkDir::new("type_list");