Skip to content

Commit 35d9991

Browse files
committed
[v6.d REVIEW] Improve -0x7FFFFFFF - 1 tests
- Use more approprirate test routines - Add test descriptions
1 parent d362df7 commit 35d9991

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

S03-operators/arith.t

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use v6;
22
use Test;
3-
plan 161;
3+
plan 159;
44

55
my $five = abs(-5);
66

@@ -400,10 +400,11 @@ isa-ok 4 % 1.1, Rat, 'infix:<%> returns Rat when it can';
400400
isa-ok 4.8 % 1.1, Rat, 'infix:<%> returns Rat when it can';
401401

402402
# RT #132083 - Broken math
403-
{
404-
is(-0x7FFFFFFF - 1 == -2147483648, True);
405-
is(-0x7FFFFFFF - 1 == -18446744071562067968 , False);
406-
is((-0x7FFFFFFF - 1).base(16), -80000000);
403+
subtest '-0x7FFFFFFF - 1 math weirdness' => {
404+
is-deeply -0x7FFFFFFF - 1 == -2147483648, True, '== -2147483648';
405+
is-deeply -0x7FFFFFFF - 1 == -18446744071562067968, False,
406+
'== -18446744071562067968';
407+
is-deeply (-0x7FFFFFFF - 1).base(16), '-80000000', '.base(16)';
407408
}
408409

409410
# vim: ft=perl6

0 commit comments

Comments
 (0)