Add -0 shortcut for --null

Fixes #419
This commit is contained in:
Roman Proskuryakov
2017-03-28 19:06:30 +03:00
committed by Andrew Gallant
parent b4bc3b6349
commit 01deac9427
3 changed files with 11 additions and 2 deletions

View File

@@ -1390,6 +1390,15 @@ clean!(feature_275_pathsep, "test", ".", |wd: WorkDir, mut cmd: Command| {
assert_eq!(lines, "fooZbar:test\n");
});
// See: https://github.com/BurntSushi/ripgrep/issues/419
sherlock!(feature_419_zero_as_shortcut_for_null, "Sherlock", ".",
|wd: WorkDir, mut cmd: Command| {
cmd.arg("-0").arg("--count");
let lines: String = wd.stdout(&mut cmd);
assert_eq!(lines, "sherlock\x002\n");
});
#[test]
fn binary_nosearch() {
let wd = WorkDir::new("binary_nosearch");