From d87951aa73a72198ae144002e551b5d019d76db6 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Thu, 23 Aug 2018 14:00:26 +0100 Subject: [PATCH] Handle Window's missing file error message --- tests/testsuite/install.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/testsuite/install.rs b/tests/testsuite/install.rs index cb4372720..4a2f88bea 100644 --- a/tests/testsuite/install.rs +++ b/tests/testsuite/install.rs @@ -870,14 +870,20 @@ error: package `foo v0.0.1 ({url})` is not installed", #[test] fn uninstall_cwd_no_project() { + let err_msg = if cfg!(windows) { + "The system cannot find the file specified." + } else { + "No such file or directory" + }; assert_that( cargo_process("uninstall"), execs().with_status(101).with_stdout("").with_stderr(format!("\ [ERROR] failed to read `{root}/Cargo.toml` Caused by: - No such file or directory (os error 2)", + {err_msg} (os error 2)", root = paths::root().display(), + err_msg = err_msg, )), ); }