Changeset 21156

Show
Ignore:
Timestamp:
07/02/08 02:43:52 (5 months ago)
Author:
Auzon
Message:

[gsoc_spectest] added some range tests for *..*. Also added some tests for bugs in Rakudo's handling of Inf versus -Int. Added some basic tests for p5=>. (added 15 tests)

Location:
t
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • t/TASKS

    r21114 r21156  
    1919S03 
    2020* tests for cmp() and eqv() methods of objects 
    21 * test 'Minimal whitespace DWIMmery'. A quick ack indicates that no tests exist to ensure that '@a  [$b]' dies. 
    2221* test that '@array, *' repeats the final element infinitely 
    2322* tests for other range edgecases 
  • t/operators/arith.t

    r20490 r21156  
    33use Test; 
    44 
    5 plan 188; 
     5plan 190; 
    66 
    77my $five = abs(-5); 
     
    4646        } 
    4747    } else { 
    48         my $error = abs($lhs - $rhs) / $lhs;  
     48        my $error = abs($lhs - $rhs) / $lhs; 
    4949        if ($todo) { 
    5050            #&ok.nextwith($error <1e-9,$todo ~ " # " ~ $lhs ~ " is close to " ~ $rhs, :todo); 
     
    314314is Inf, Inf; 
    315315is -Inf, -Inf; 
     316isnt Inf, -Inf; 
     317is -Inf.abs, Inf; 
    316318is Inf+100, Inf; 
    317319is Inf-100, Inf; 
     
    371373is $nan3, NaN, "Inf**NaN"; 
    372374 
     375=begin pod 
     376 
    373377=head2 BEHAVIOUR OF DIVISION AND MODULUS WITH ZERO 
    374378 
     
    379383'die' should be non-fatal. 
    380384 
    381 =cut 
     385=end pod 
    382386 
    383387my $x; 
  • t/spec/S02-builtin_data_types/range.t

    r21088 r21156  
    33use Test; 
    44 
    5 plan 31; 
    6  
     5plan 39; 
    76 
    87# basic Range 
     8# L<S02/Immutable types/A pair of Ordered endpoints; gens immutables when iterated> 
    99 
    1010my $r = 1..5; 
     
    7676} 
    7777 
    78 # vim:set ft=perl: 
     78# infinite range 
     79#?rakudo skip '*..* not implemented' 
     80{ 
     81    my @inf = *..*; 
     82 
     83    is(@inf.shift, -Inf, 'bottom end of *..* is -Inf (1)'); 
     84    is(@inf.shift, -Inf, 'bottom end of *..* is still -Inf (2)'); 
     85 
     86    is(@inf.pop, Inf, 'top end of *..* is Inf (1)'); 
     87    is(@inf.pop, Inf, 'top end of *..* is still Inf (2)'); 
     88 
     89    ok(42  ~~ @inf, 'positive integer matches *..*'); 
     90    ok(.2  ~~ @inf, 'positive non-int matches *..*'); 
     91    ok(-2  ~~ @inf, 'negative integer matches *..*'); 
     92    ok(-.2 ~~ @inf, 'negative non-int matches *..*'); 
     93} 
     94 
     95# vim:set ft=perl6