mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-03 15:01:16 -03:00
tests/parse_util: Check against localized message
This is run in the current locale, without resetting to en_US.UTF-8 like our integration tests do. So if you want to check for a specific message you need to check the localized version.
This commit is contained in:
@@ -55,9 +55,10 @@ macro_rules! validate {
|
||||
($src:expr, $error_text_format:expr) => {
|
||||
let mut errors = vec![];
|
||||
let res = parse_util_detect_errors(L!($src), Some(&mut errors), false);
|
||||
let fmt = wgettext!($error_text_format);
|
||||
assert!(res.is_err());
|
||||
assert!(
|
||||
string_matches_format(&errors[0].text, L!($error_text_format)),
|
||||
string_matches_format(&errors[0].text, fmt),
|
||||
"command '{}' is expected to match error pattern '{}' but is '{}'",
|
||||
$src,
|
||||
$error_text_format,
|
||||
|
||||
Reference in New Issue
Block a user