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:
Fabian Boehm 2024-01-20 12:27:56 +01:00
parent 2cb60bed10
commit f7b541af99

View file

@ -55,9 +55,10 @@ fn test_error_messages() {
($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,