This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Scalar-List-Util to 1.60
[perl5.git] / cpan / Scalar-List-Utils / t / product.t
index 87e887c..3ff5ae0 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 25;
+use Test::More tests => 27;
 
 use Config;
 use List::Util qw(product);
@@ -32,6 +32,13 @@ is( $v, 0, '1 * 0');
 $v = product(0, 0);
 is( $v, 0, 'two 0');
 
+# RT139601 cornercases
+{
+  # Numify the result because some older perl versions see "-0" as a string
+  is( 0+product(-1.0, 0), 0, 'product(-1.0, 0)' );
+  is( 0+product(-1, 0), 0, 'product(-1, 0)' );
+}
+
 my $x = -3;
 
 $v = product($x, 3);