This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Change #11805 didn't update the MANIFEST
[perl5.git] / t / op / inc.t
index e5a2a92..f59115e 100755 (executable)
@@ -1,9 +1,6 @@
 #!./perl
 
-
-# $RCSfile$
-
-print "1..6\n";
+print "1..12\n";
 
 # Verify that addition/subtraction properly upgrade to doubles.
 # These tests are only significant on machines with 32 bit longs,
@@ -50,3 +47,51 @@ if ($a == -2147483649)
        {print "ok 6\n"}
 else
        {print "not ok 6\n";}
+
+$a = 2147483648;
+$a = -$a;
+$c=$a--;
+if ($a == -2147483649) 
+       {print "ok 7\n"}
+else
+       {print "not ok 7\n";}
+
+$a = 2147483648;
+$a = -$a;
+$c=--$a;
+if ($a == -2147483649) 
+       {print "ok 8\n"}
+else
+       {print "not ok 8\n";}
+
+$a = 2147483648;
+$a = -$a;
+$a=$a-1;
+if ($a == -2147483649) 
+       {print "ok 9\n"}
+else
+       {print "not ok 9\n";}
+
+$a = 2147483648;
+$b = -$a;
+$c=$b--;
+if ($b == -$a-1) 
+       {print "ok 10\n"}
+else
+       {print "not ok 10\n";}
+
+$a = 2147483648;
+$b = -$a;
+$c=--$b;
+if ($b == -$a-1) 
+       {print "ok 11\n"}
+else
+       {print "not ok 11\n";}
+
+$a = 2147483648;
+$b = -$a;
+$b=$b-1;
+if ($b == -(++$a)) 
+       {print "ok 12\n"}
+else
+       {print "not ok 12\n";}