]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid a false failure in expr test with UTF8
authorPádraig Brady <P@draigBrady.com>
Thu, 21 Sep 2017 05:12:20 +0000 (22:12 -0700)
committerPádraig Brady <P@draigBrady.com>
Thu, 21 Sep 2017 05:21:31 +0000 (22:21 -0700)
* tests/misc/expr.pl: Skip the quote varying tests in
the multi-byte locales as these tests aren't that interesting
in those locales.  Also ERR_SUBST is already defined for
some tests so awkward to redefine to munge UTF8 quotes to ASCII.

tests/misc/expr.pl

index cb86851ef32d8995c31f82e152178fc86d1e97cb..5220e1f3f5ee5876a827b8ea870acb9fd351ddcd 100755 (executable)
@@ -164,8 +164,6 @@ my @Tests =
      ['bre61', '"acd" : "a\\(b\\)?c\\1d"', {OUT => ''}, {EXIT => 1}],
      ['bre62', '-- "-5" : "-\\{0,1\\}[0-9]*\$"', {OUT => '2'}],
 
-     ['fail-b', '9 9',
-      {ERR => "$prog: syntax error: unexpected argument '9'\n"}, {EXIT => 2}],
      ['fail-c', {ERR => "$prog: missing operand\n"
                  . "Try '$prog --help' for more information.\n"},
       {EXIT => 2}],
@@ -179,6 +177,8 @@ my @Tests =
 
 
      # Test syntax error messages
+     ['se0', '9 9',
+      {ERR => "$prog: syntax error: unexpected argument '9'\n"}, {EXIT => 2}],
      ['se1', "2 a", {EXIT=>2},
       {ERR=>"$prog: syntax error: unexpected argument 'a'\n"}],
      ['se2', "2 '+'", {EXIT=>2},
@@ -210,6 +210,8 @@ foreach $t (@Tests)
       }
   }
 
+# Try multibyte locale in most tests.
+#
 if ($mb_locale ne 'C')
   {
     # Duplicate each test vector, appending "-mb" to the test name and
@@ -218,6 +220,10 @@ if ($mb_locale ne 'C')
     my @new;
     foreach my $t (@Tests)
       {
+        # Don't add the quote varying tests to the multi-byte set
+        $t->[0] =~ /^se/
+        and next;
+
         my @new_t = @$t;
         my $test_name = shift @new_t;