Add --path-separator flag.

This flag permits setting the path separator used for all file paths
printed by ripgrep in normal operation.

Fixes #275
This commit is contained in:
Andrew Gallant
2017-01-10 18:16:15 -05:00
parent 2143bcf9cb
commit 8751e55706
6 changed files with 89 additions and 5 deletions

View File

@@ -1226,6 +1226,16 @@ clean!(feature_263_sort_files, "test", ".", |wd: WorkDir, mut cmd: Command| {
assert_eq!(lines, "abc:test\nbar:test\nfoo:test\nzoo:test\n");
});
// See: https://github.com/BurntSushi/ripgrep/issues/275
clean!(feature_275_pathsep, "test", ".", |wd: WorkDir, mut cmd: Command| {
wd.create_dir("foo");
wd.create("foo/bar", "test");
cmd.arg("--path-separator").arg("Z");
let lines: String = wd.stdout(&mut cmd);
assert_eq!(lines, "fooZbar:test\n");
});
#[test]
fn binary_nosearch() {
let wd = WorkDir::new("binary_nosearch");