summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarc Tiehuis <marctiehuis@gmail.com>2017-05-20 00:12:38 +1200
committerAndrew Gallant <jamslam@gmail.com>2017-05-19 20:00:47 -0400
commit229b8e3b3322177e2a518d87358b3503dfc18cdf (patch)
treea06f23da9061d642fbb1f0d90aad0afc1f67b4bc /tests
parenta515c4d601e449dd78441e7f7e14ab0c2299ac02 (diff)
Make --quiet flag apply when using --files option
Fixes #483.
Diffstat (limited to 'tests')
-rw-r--r--tests/tests.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs
index 95c6e6a5..930aa165 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -1652,6 +1652,35 @@ fn regression_451_only_matching() {
assert_eq!(lines, expected);
}
+// See: https://github.com/BurntSushi/ripgrep/issues/483
+#[test]
+fn regression_483_matching_no_stdout() {
+ let wd = WorkDir::new("regression_483_matching_no_stdout");
+ wd.create("file.py", "");
+
+ let mut cmd = wd.command();
+ cmd.arg("--quiet")
+ .arg("--files")
+ .arg("--glob").arg("*.py");
+
+ let lines: String = wd.stdout(&mut cmd);
+ assert!(lines.is_empty());
+}
+
+// See: https://github.com/BurntSushi/ripgrep/issues/483
+#[test]
+fn regression_483_non_matching_exit_code() {
+ let wd = WorkDir::new("regression_483_non_matching_exit_code");
+ wd.create("file.rs", "");
+
+ let mut cmd = wd.command();
+ cmd.arg("--quiet")
+ .arg("--files")
+ .arg("--glob").arg("*.py");
+
+ wd.assert_err(&mut cmd);
+}
+
#[test]
fn type_list() {
let wd = WorkDir::new("type_list");