Fix windows chooser invocation error message test (#1079)
This commit is contained in:
parent
27cd8fd554
commit
b95e32c9be
@ -125,11 +125,7 @@ fn invoke_error_function() {
|
||||
echo bar
|
||||
",
|
||||
)
|
||||
.stderr(if cfg!(windows) {
|
||||
"error: Chooser `/ -cu fzf` invocation failed: Access is denied. (os error 5)\n"
|
||||
} else {
|
||||
"error: Chooser `/ -cu fzf` invocation failed: Permission denied (os error 13)\n"
|
||||
})
|
||||
.stderr_regex("error: Chooser `/ -cu fzf` invocation failed: .*")
|
||||
.status(EXIT_FAILURE)
|
||||
.shell(false)
|
||||
.args(&["--shell", "/", "--choose"])
|
||||
|
@ -125,7 +125,7 @@ impl Test {
|
||||
}
|
||||
|
||||
pub(crate) fn stderr_regex(mut self, stderr_regex: impl AsRef<str>) -> Self {
|
||||
self.stderr_regex = Some(Regex::new(&format!("^{}$", stderr_regex.as_ref())).unwrap());
|
||||
self.stderr_regex = Some(Regex::new(&format!("(?m)^{}$", stderr_regex.as_ref())).unwrap());
|
||||
self
|
||||
}
|
||||
|
||||
@ -223,7 +223,7 @@ impl Test {
|
||||
if let Some(ref stderr_regex) = self.stderr_regex {
|
||||
if !stderr_regex.is_match(output_stderr) {
|
||||
panic!(
|
||||
"Stderr regex mismatch: {} !~= /{}/",
|
||||
"Stderr regex mismatch:\n{:?}\n!~=\n/{:?}/",
|
||||
output_stderr, stderr_regex
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user