Show
Ignore:
Timestamp:
07/03/08 21:20:14 (5 months ago)
Author:
moritz
Message:

[spec] arith.t more fudging, not quite there yet

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • t/spec/S03-operators/arith.t

    r21189 r21190  
    1717 
    1818#?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     } 
     19sub tryeq ($lhs, $rhs) { 
     20    ok($lhs == $rhs); 
    2721} 
    2822 
    2923#?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 } 
    3924sub tryeq_sloppy ($lhs, $rhs, $todo1 = '') { 
    4025    my $todo = $todo1;  # TODO is rw 
     
    7560my $limit = 1e6; 
    7661 
    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; 
     62ok abs( 13e21 %  4e21 -  1e21) < $limit; 
     63ok abs(-13e21 %  4e21 -  3e21) < $limit; 
     64ok abs( 13e21 % -4e21 - -3e21) < $limit; 
     65ok abs(-13e21 % -4e21 - -1e21) < $limit; 
    8166 
    8267# UVs, IVs, etc make no sense but the tests are useful anyhow. 
     
    212197 
    213198# 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} 
    218206 
    219207# check with 0xFFFF and 0x10001 
     
    408396my $x; 
    409397 
     398#?rakudo 3 todo 'modulo by zero' 
    410399dies_ok( { say 3 % 0 }, 'Modulo zero dies and is catchable'); 
    411400dies_ok( { $x = 0; say 3 % $x; }, 'Modulo zero dies and is catchable with VInt/VRat variables');