components/coreutils/patches/tests-misc-expr.patch
author Rich Burridge <rich.burridge@oracle.com>
Thu, 15 May 2014 16:58:20 -0700
changeset 1898 5c902a3c6e7e
parent 1833 0edb05d72e6b
permissions -rw-r--r--
18744156 /usr/gnu/bin/chroot is killed when executed with an invalid command argument

The tests/misc/expr test is broken by default in version 8.16.

Looking at the ChangeLog for GNU coreutils 8.19, I found:

2012-04-03  Jim Meyering  <[email protected]>
...
        tests: avoid spurious misc/expr failure on AIX 6.1
        * tests/misc/expr: Avoid spurious failure on AIX 6.1 due to
        differing regexp diagnostic.  Reported by Michael Felt.

If I use the .../tests/misc/expr test script from 8.19, it works fine.
So I've added the 'tests-misc-expr.patch' file to do just that.

---  coreutils-8.16/tests/misc/expr.orig	2012-09-03 07:18:28.214998564 -0700
+++  coreutils-8.16/tests/misc/expr	2012-09-03 07:22:12.547808280 -0700
@@ -140,7 +140,11 @@
      ['bre48', '_ : "a\\{1,x"',
       {ERR => "$prog: Unmatched \\{\n"}, {EXIT => 2}],
      ['bre49', '_ : "a\\{32768\\}"',
-      {ERR => "$prog: Invalid content of \\{\\}\n"}, {EXIT => 2}],
+      {ERR => "$prog: Invalid content of \\{\\}\n"}, {EXIT => 2},
+      # Map AIX-6's different diagnostic to the one we expect:
+      {ERR_SUBST =>
+       's,Regular expression too big,Invalid content of \\\\{\\\\},'},
+      ],
      ['bre50', '_ : "a\\{1,0\\}"',
       {ERR => "$prog: Invalid content of \\{\\}\n"}, {EXIT => 2}],
      ['bre51', '"acabc" : ".*ab\\{0,0\\}c"', {OUT => '2'}],
@@ -171,7 +175,7 @@
     );
 
 # If using big numbers fails, remove all /^bignum-/ tests
-`expr $big_prod '*' $big_prod '*' $big_prod`
+qx!expr $big_prod '*' $big_prod '*' $big_prod!
   or @Tests = grep {$_->[0] !~ /^bignum-/} @Tests;
 
 # Append a newline to end of each expected 'OUT' string.