From a2a39f288f7bf58c4bbc73cea21431c688b35791 Mon Sep 17 00:00:00 2001 From: Siddhant Saraf Date: Sun, 27 May 2012 23:56:51 +0530 Subject: [PATCH] [S03-operators/overflow.t] better test labels; moritz++ for suggestion --- S03-operators/overflow.t | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/S03-operators/overflow.t b/S03-operators/overflow.t index b136e901f9..a76b6e5ce9 100644 --- a/S03-operators/overflow.t +++ b/S03-operators/overflow.t @@ -148,9 +148,9 @@ sub tryeq_sloppy ($lhs, $rhs, $todo1 = '') { } { - is 2147483648 - 0, 2147483648, '2147483648 = 2147483648'; - is -2147483648 - 0, -2147483648, '-2147483648 = -2147483648'; - is 2000000000 - 4000000000, -2000000000, '-2000000000 = -2000000000'; + is 2147483648 - 0, 2147483648, '2147483648 - 0 == 2147483648'; + is -2147483648 - 0, -2147483648, '-2147483648 - 0 == -2147483648'; + is 2000000000 - 4000000000, -2000000000, '2000000000 - 4000000000 == -2000000000'; } # Believe it or not, this one overflows on 32-bit Rakduo as of 3/8/2010. @@ -170,26 +170,26 @@ sub tryeq_sloppy ($lhs, $rhs, $todo1 = '') { # On a 32 bit machine, if the i_multiply op is used, you will probably get # -167772160. It's actually undefined behaviour, so anything may happen. my $int = ($n % 1000) * 167772160; - is $int, 21307064320, "$int = 21307064320"; + is $int, 21307064320, '(1127 % 1000) * 167772160 == 21307064320'; } { - is -1 - -2147483648, 2147483647, '2147483647 = 2147483647'; - is 2 - -2147483648, 2147483650, '2147483650 = 2147483650'; + is -1 - -2147483648, 2147483647, '-1 - -2147483648 == 2147483647'; + is 2 - -2147483648, 2147483650, '2 - -2147483648 == 2147483650'; - is 4294967294 - 3, 4294967291, '4294967291 = 4294967291'; - is -2147483648 - -1, -2147483647, '-2147483647 = -2147483647'; + is 4294967294 - 3, 4294967291, '4294967294 - 3 == 4294967291'; + is -2147483648 - -1, -2147483647, '-2147483648 - -1 == -2147483647'; # IV - IV promote to UV - is 2147483647 - -1, 2147483648, '2147483648 = 2147483648'; - is 2147483647 - -2147483648, 4294967295, '4294967295 = 4294967295'; + is 2147483647 - -1, 2147483648, '2147483647 - -1 == 2147483648'; + is 2147483647 - -2147483648, 4294967295, '2147483647 - -2147483648 == 4294967295'; # UV - IV promote to NV - is 4294967294 - -3, 4294967297, '4294967297 = 4294967297'; + is 4294967294 - -3, 4294967297, '4294967294 - -3 == 4294967297'; # IV - IV promote to NV - is -2147483648 - +1, -2147483649, '-2147483649 = -2147483649'; + is -2147483648 - +1, -2147483649, '-2147483648 - +1 == -2147483649'; # UV - UV promote to IV - is 2147483648 - 2147483650, -2, '-2 = -2'; + is 2147483648 - 2147483650, -2, '2147483648 - 2147483650 == -2'; } # check with 0xFFFF and 0xFFFF