summaryrefslogtreecommitdiffstats
path: root/tests/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tests.rs')
-rw-r--r--tests/tests.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs
index d08dc6ae..1341aa10 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -550,6 +550,7 @@ sherlock!(unrestricted2, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
assert_eq!(lines, expected);
});
+#[cfg(not(windows))]
sherlock!(unrestricted3, "foo", ".", |wd: WorkDir, mut cmd: Command| {
wd.create("file", "foo\x00bar\nfoo\x00baz\n");
cmd.arg("-uuu");
@@ -558,6 +559,16 @@ sherlock!(unrestricted3, "foo", ".", |wd: WorkDir, mut cmd: Command| {
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]
fn binary_nosearch() {
let wd = WorkDir::new("binary_nosearch");