From 712311fdc6f569960ad80716e1b3071886df1821 Mon Sep 17 00:00:00 2001 From: Sebastian Nowicki Date: Mon, 16 Oct 2017 14:35:26 +0200 Subject: [PATCH] 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. --- tests/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests.rs b/tests/tests.rs index 218ca56..4de1321 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);