]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
factor: simplify tests by assuming libgmp
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 8 Jul 2020 06:48:53 +0000 (23:48 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 8 Jul 2020 15:11:57 +0000 (08:11 -0700)
* tests/misc/factor.pl: Test bignums even if !HAVE_GMP.

tests/misc/factor.pl

index 7bbef8a359772fc4b5683bf7bfece1814c8665f2..ecd2ab293efd71007a764c733733922c9fa806f8 100755 (executable)
@@ -80,17 +80,14 @@ my @Tests =
       {OUT => '15601 26449 111427 4830277'}],
      ['bug-2016-c', '12847291069740315094892340035',
       {OUT => '5 4073 18899 522591721 63874247821'}],
+     ['bug-gmp-2_sup_128', '340282366920938463463374607431768211456',
+      {OUT => '2 'x127 . '2'}],
+     ['bug-gmp-2_sup_256',
+      '115792089237316195423570985008687907853'
+      . '269984665640564039457584007913129639936',
+      {OUT => '2 'x255 . '2'}],
     );
 
-# If we have GMP support, append tests to exercise it.
-(system "grep '^#define HAVE_GMP 1' $ENV{CONFIG_HEADER} > /dev/null") == 0
-  and push (@Tests,
-            ['bug-gmp-2_sup_128', '340282366920938463463374607431768211456',
-             {OUT => '2 'x127 . '2'}],
-            ['bug-gmp-2_sup_256',
-             '115792089237316195423570985008687907853'
-             . '269984665640564039457584007913129639936',
-             {OUT => '2 'x255 . '2'}]);
 
 # Prepend the command line argument and append a newline to end
 # of each expected 'OUT' string.