Changeset 21190
- Timestamp:
- 07/03/08 21:20:14 (3 months ago)
- Files:
-
- 1 modified
-
t/spec/S03-operators/arith.t (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
t/spec/S03-operators/arith.t
r21189 r21190 17 17 18 18 #?DOES 1 19 sub tryok ($ok, $todo = '') { 20 if ($todo) { 21 #&ok.nextwith($ok,$todo, :todo); 22 ok($ok,$todo, :todo); 23 } else { 24 #&ok.nextwith($ok); 25 ok($ok); 26 } 19 sub tryeq ($lhs, $rhs) { 20 ok($lhs == $rhs); 27 21 } 28 22 29 23 #?DOES 1 30 sub tryeq ($lhs, $rhs, $todo = '') {31 if ($todo) {32 #&ok.nextwith($lhs == $rhs,$todo ~ " " ~ $lhs ~ " != " ~ $rhs, :todo);33 ok($lhs == $rhs,$todo ~ " " ~ $lhs ~ " != " ~ $rhs, :todo);34 } else {35 #&ok.nextwith($lhs == $rhs);36 ok($lhs == $rhs);37 }38 }39 24 sub tryeq_sloppy ($lhs, $rhs, $todo1 = '') { 40 25 my $todo = $todo1; # TODO is rw … … 75 60 my $limit = 1e6; 76 61 77 tryok abs( 13e21 % 4e21 - 1e21) < $limit;78 tryok abs(-13e21 % 4e21 - 3e21) < $limit;79 tryok abs( 13e21 % -4e21 - -3e21) < $limit;80 tryok abs(-13e21 % -4e21 - -1e21) < $limit;62 ok abs( 13e21 % 4e21 - 1e21) < $limit; 63 ok abs(-13e21 % 4e21 - 3e21) < $limit; 64 ok abs( 13e21 % -4e21 - -3e21) < $limit; 65 ok abs(-13e21 % -4e21 - -1e21) < $limit; 81 66 82 67 # UVs, IVs, etc make no sense but the tests are useful anyhow. … … 212 197 213 198 # check with 0xFFFF and 0xFFFF 214 tryeq 65535 * 65535, 4294836225; 215 tryeq 65535 * -65535, -4294836225; 216 tryeq -65535 * 65535, -4294836225; 217 tryeq -65535 * -65535, 4294836225; 199 #?rakudo skip 'arithmetics' 200 { 201 tryeq 65535 * 65535, 4294836225; 202 tryeq 65535 * -65535, -4294836225; 203 tryeq -65535 * 65535, -4294836225; 204 tryeq -65535 * -65535, 4294836225; 205 } 218 206 219 207 # check with 0xFFFF and 0x10001 … … 408 396 my $x; 409 397 398 #?rakudo 3 todo 'modulo by zero' 410 399 dies_ok( { say 3 % 0 }, 'Modulo zero dies and is catchable'); 411 400 dies_ok( { $x = 0; say 3 % $x; }, 'Modulo zero dies and is catchable with VInt/VRat variables');
