summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2016-09-21 21:07:36 -0400
committerAndrew Gallant <jamslam@gmail.com>2016-09-21 21:07:36 -0400
commitb80a986721293829251361b6cad8cbf5d0ad61e9 (patch)
tree9a9b2d3d85d037ea3ee91704f404f42ce85ba409
parent8a91d3132fc3fed85229ce125ba0bbfbbfc2e0d0 (diff)
fix -uuu test on Windows
-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");