Changeset 21149

Show
Ignore:
Timestamp:
07/01/08 23:05:31 (3 months ago)
Author:
moritz
Message:

[spec] fudged S03-junctions/misc.t

Files:
1 modified

Legend:

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

    r21148 r21149  
    5656    ok('c' eq ($c | $a | $b), 'junction of ($c | $a | $b) matches at least one "c"');  
    5757 
     58    #?rakudo 3 skip 'infix:<===>' 
    5859    ok(not(('a' eq ($b | $c | $a)) === Bool::False), 'junctional comparison doesn not mistakenly return both true and false'); 
    5960    ok(not(('b' eq ($a | $b | $c)) === Bool::False), 'junctional comparison doesn not mistakenly return both true and false'); 
     
    6263    # test junction to junction 
    6364     
     65    #?rakudo todo 'Compare junctions with junctions' 
    6466    ok(('a' | 'b' | 'c') eq ($a & $b & $c), 'junction ("a" | "b" | "c") matches junction ($a & $b & $c)');     
    6567    ok(('a' & 'b' & 'c') eq ($a | $b | $c), 'junction ("a" & "b" & "c") matches junction ($a | $b | $c)');  
     
    123125} 
    124126 
    125 { 
    126     my ($j,$k,$l); 
     127#?rakudo skip 'prefix:<\\>' 
     128{ 
     129    my $j; 
     130    my $k; 
     131    my $l; 
    127132 
    128133    $j = 1|2; 
     
    152157sub j (Junction $j) { return $j.perl } 
    153158 
     159#?rakudo skip 'Junction Authreading' 
    154160{ 
    155161    # L<S03/Junctive operators/They thread through operations> 
    156     my ($got, $want); 
     162    my $got; 
     163    my $want; 
    157164    $got = ((1|2|3)+4); 
    158165    $want = (5|6|7); 
     
    165172    # L<S03/Junctive operators/This opens doors for constructions like> 
    166173    # unless $roll == any(1..6) { print "Invalid roll" } 
    167     my ($roll, $note); 
     174    my $roll; 
     175    my $note; 
    168176    $roll = 3; $note = ''; 
    169177    unless $roll == any(1..6) { $note = "Invalid roll"; }; 
     
    185193 
    186194    # L<S03/Junctive operators/Junctions work through subscripting> 
    187     my ($got, @foo); 
     195    my $got; 
     196    my @foo; 
    188197    $got = ''; @foo = (); 
    189198    $got ~= 'y' if try { @foo[any(1,2,3)] }; 
     
    226235=end description 
    227236 
     237#?rakudo skip 'Junctions of Code Objects' 
    228238{ 
    229239    my @subs = (sub {3}, sub {2}); 
    230240 
    231     my ($got, $want); 
     241    my $got; 
     242    my $want; 
    232243 
    233244    is(j(any(@subs)()), j(3|2), '.() on any() junction of subs'); 
     
    267278} 
    268279 
    269 is(none(1).pick, undef, 'none(1).pick should be undef'); 
    270 is(none(1,1).pick, undef, 'none(1,1).pick should be undef'); 
    271  
    272 is(one(1).pick, 1, 'one(1).pick should be 1'); 
    273 is(one(1,1).pick, undef, 'one(1,1).pick should be undef'); 
    274  
    275 is(all(1).pick, 1, 'all(1).pick should be 1'); 
    276 is(all(1,1).pick, 1, 'all(1,1).pick should be 1'); 
    277 is(all(1,2).pick, undef, 'all(1,2).pick should be undef'); 
     280#?rakudo skip 'Junction.pick' 
     281{ 
     282    is(none(1).pick, undef, 'none(1).pick should be undef'); 
     283    is(none(1,1).pick, undef, 'none(1,1).pick should be undef'); 
     284 
     285    is(one(1).pick, 1, 'one(1).pick should be 1'); 
     286    is(one(1,1).pick, undef, 'one(1,1).pick should be undef'); 
     287 
     288    is(all(1).pick, 1, 'all(1).pick should be 1'); 
     289    is(all(1,1).pick, 1, 'all(1,1).pick should be 1'); 
     290    is(all(1,2).pick, undef, 'all(1,2).pick should be undef'); 
     291} 
    278292 
    279293# junction in boolean context 
    280294ok(?(0&0) == ?(0&&0), 'boolean context'); 
     295#?rakudo todo 'boolen context of junctions' 
    281296ok(?(0&1) == ?(0&&1), 'boolean context'); 
    282297ok(?(1&1) == ?(1&&1), 'boolean context'); 
     298#?rakudo todo 'boolen context of junctions' 
    283299ok(?(1&0) == ?(1&&0), 'boolean context'); 
    284300ok(!(?(0&0) != ?(0&&0)), 'boolean context');