>From 28a3208e3ce8adde0b0d827868213dd8aac032a1 Mon Sep 17 00:00:00 2001 From: Assaf Gordon Date: Sun, 24 Sep 2017 12:40:52 -0600 Subject: [PATCH] tests: adjust expr syntax error tests for multibyte locales Follow up to commit v8.28-9-g454d7f3 ("expr: add detailed syntax error messages"). Replace multibyte quote characters with ASCII single quotes. Reported by Paul Eggert in https://bugs.gnu.org/28582 . * tests/misc/expr.pl: When generating multibyte test definitions, add ERR_SUBST key replacing multibyte quotes with ASCII single quotes. --- tests/misc/expr.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/misc/expr.pl b/tests/misc/expr.pl index cb86851..7427ac8 100755 --- a/tests/misc/expr.pl +++ b/tests/misc/expr.pl @@ -221,7 +221,14 @@ if ($mb_locale ne 'C') my @new_t = @$t; my $test_name = shift @new_t; - push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; + push @new_t, {ENV => "LC_ALL=$mb_locale"}; + + # Replace multibyte quotes with single quotes (ASCII 0x27) + # (unless the test already has an ERR_SUBST key). + push @new_t, {ERR_SUBST => "s/\xe2\x80[\x98\x99]/'/g"} + unless grep {ref $_ eq 'HASH' and exists $_->{ERR_SUBST}} @new_t; + + push @new, ["$test_name-mb", @new_t]; } push @Tests, @new; } -- 2.7.4