Subject: Re: bug#28582: Coreutils 'make check' failure due to expr change

From: Assaf Gordon <[email-masked]>
Date: Sun, 24 Sep 2017 12:46:04 -0600

Hello Paul,

On 2017-09-24 10:48 AM, Paul Eggert wrote:
> When I run 'make check' for bleeding-edge Coreutils, I get a failure due
> to recent changes in expr. tests/misc/expr.log is attached. Evidently
> the recent changes are not taking message translation into account.

Thank you for catching this.

The attached patch should fix it.

regards,
 - assaf

>From 28a3208e3ce8adde0b0d827868213dd8aac032a1 Mon Sep 17 00:00:00 2001
From: Assaf Gordon <[email-masked]>
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