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
|
echo bar
|
||||||
",
|
",
|
||||||
)
|
)
|
||||||
.stderr(if cfg!(windows) {
|
.stderr_regex("error: Chooser `/ -cu fzf` invocation failed: .*")
|
||||||
"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"
|
|
||||||
})
|
|
||||||
.status(EXIT_FAILURE)
|
.status(EXIT_FAILURE)
|
||||||
.shell(false)
|
.shell(false)
|
||||||
.args(&["--shell", "/", "--choose"])
|
.args(&["--shell", "/", "--choose"])
|
||||||
|
@ -125,7 +125,7 @@ impl Test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn stderr_regex(mut self, stderr_regex: impl AsRef<str>) -> Self {
|
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
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ impl Test {
|
|||||||
if let Some(ref stderr_regex) = self.stderr_regex {
|
if let Some(ref stderr_regex) = self.stderr_regex {
|
||||||
if !stderr_regex.is_match(output_stderr) {
|
if !stderr_regex.is_match(output_stderr) {
|
||||||
panic!(
|
panic!(
|
||||||
"Stderr regex mismatch: {} !~= /{}/",
|
"Stderr regex mismatch:\n{:?}\n!~=\n/{:?}/",
|
||||||
output_stderr, stderr_regex
|
output_stderr, stderr_regex
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user