summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Nowicki <sebnow@gmail.com>2017-10-16 14:35:26 +0200
committerAndrew Gallant <jamslam@gmail.com>2017-10-20 20:51:12 -0400
commit712311fdc6f569960ad80716e1b3071886df1821 (patch)
tree3c5b1267f219af1ce0dc4bee58fee3d9068d02ee
parent0d2354aca6a6a399b01047e1cfaf14cd17099f34 (diff)
Don't create command until we know we can test it
For regression 210 we may not actually need to test anything if the file system doesn't support creating files with invalid UTF-8 bytes. Don't create the command until we know there will be an assertion.
-rw-r--r--tests/tests.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/tests.rs b/tests/tests.rs
index 218ca56a..4de13216 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -1014,10 +1014,10 @@ fn regression_210() {
let badutf8 = OsStr::from_bytes(&b"foo\xffbar"[..]);
let wd = WorkDir::new("regression_210");
- let mut cmd = wd.command();
// APFS does not support creating files with invalid UTF-8 bytes.
// https://github.com/BurntSushi/ripgrep/issues/559
if wd.try_create(badutf8, "test").is_ok() {
+ let mut cmd = wd.command();
cmd.arg("-H").arg("test").arg(badutf8);
let out = wd.output(&mut cmd);