mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-01 04:32:01 -07:00
fix -uuu test on Windows
This commit is contained in:
@@ -550,6 +550,7 @@ sherlock!(unrestricted2, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
|
|||||||
assert_eq!(lines, expected);
|
assert_eq!(lines, expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#[cfg(not(windows))]
|
||||||
sherlock!(unrestricted3, "foo", ".", |wd: WorkDir, mut cmd: Command| {
|
sherlock!(unrestricted3, "foo", ".", |wd: WorkDir, mut cmd: Command| {
|
||||||
wd.create("file", "foo\x00bar\nfoo\x00baz\n");
|
wd.create("file", "foo\x00bar\nfoo\x00baz\n");
|
||||||
cmd.arg("-uuu");
|
cmd.arg("-uuu");
|
||||||
@@ -558,6 +559,16 @@ sherlock!(unrestricted3, "foo", ".", |wd: WorkDir, mut cmd: Command| {
|
|||||||
assert_eq!(lines, "file:foo\nfile:foo\n");
|
assert_eq!(lines, "file:foo\nfile:foo\n");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// On Windows, this test uses memory maps, so the NUL bytes don't get replaced.
|
||||||
|
#[cfg(windows)]
|
||||||
|
sherlock!(unrestricted3, "foo", ".", |wd: WorkDir, mut cmd: Command| {
|
||||||
|
wd.create("file", "foo\x00bar\nfoo\x00baz\n");
|
||||||
|
cmd.arg("-uuu");
|
||||||
|
|
||||||
|
let lines: String = wd.stdout(&mut cmd);
|
||||||
|
assert_eq!(lines, "file:foo\x00bar\nfile:foo\x00baz\n");
|
||||||
|
});
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn binary_nosearch() {
|
fn binary_nosearch() {
|
||||||
let wd = WorkDir::new("binary_nosearch");
|
let wd = WorkDir::new("binary_nosearch");
|
||||||
|
Reference in New Issue
Block a user