Changeset 22938 for t

Show
Ignore:
Timestamp:
11/09/08 19:21:21 (2 months ago)
Author:
moritz
Message:

[t] move some junction tests

Location:
t
Files:
1 added
1 removed
1 modified
1 moved

Legend:

Unmodified
Added
Removed
  • t/spec/S03-junctions/basic.t

    r22477 r22938  
    33use Test; 
    44 
    5 plan 23; 
     5plan 22; 
    66 
    77=begin pod 
     
    1414 
    1515my $j = any(1, 2, 3); 
    16 is(WHAT($j), 'Junction', '$j is a Junc'); 
     16ok $j ~~ Junction, '$j is a Junction'; 
    1717 
    18 is($j.perl, '\(1 | 2 | 3)', 'got the right stringified junction'); 
    19  
    20 my @values = $j.values; 
     18my @values = $j.values.sort; 
    2119is(+@values, 3, 'our junction has three values in it'); 
    2220 
    23 # XXX relies on the order of elements in Junction, which is not allowed. 
    2421is(@values[0], 1, 'our junctions first value is 1'); 
    2522is(@values[1], 2, 'our junctions second value is 2'); 
     
    2825my $sums = $j + 3; 
    2926 
    30 is(WHAT($sums), 'Junction', '$sums is a Junc'); 
     27ok $sums ~~ Junction, '$j + 3 is also a Junction'; 
    3128 
    3229my @sums_values = sort $sums.values; 
     
    3835# loop enough to go through it twice 
    3936for (1 .. 6) { 
    40     ok((1 ^ 2 ^ 3) == $j.pick, 'it is always at least one'); 
    41     ok((1 | 2 | 3) == $j.pick, 'it is always one of them'); 
     37    ok((1 ^ 2 ^ 3) == $j.values.pick, 'it is always at least one'); 
     38    ok((1 | 2 | 3) == $j.values.pick, 'it is always one of them'); 
    4239} 
  • t/spec/S03-junctions/misc.t

    r22895 r22938  
    33use Test; 
    44 
    5 plan 76; 
     5plan 78; 
    66 
    77=begin pod 
     
    324324    is $c, 1, 'if modifier with junction should be called once'; 
    325325} 
     326 
     327{ 
     328    my @array = <1 2 3 4 5 6 7 8>; 
     329    ok( all(@array) == one(@array), "all(@x) == one(@x) tests uniqueness(+ve)" ); 
     330 
     331    push @array, 6; 
     332    ok( !( all(@array) == one(@array) ), "all(@x) == one(@x) tests uniqueness(-ve)" ); 
     333 
     334}