Changeset 21162

Show
Ignore:
Timestamp:
07/02/08 06:01:18 (3 months ago)
Author:
pmichaud
Message:

Some updates to S29-list.

Location:
t/spec/S29-list
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • t/spec/S29-list/grep.t

    r21138 r21162  
    2424} 
    2525 
    26 #?rakudo skip "adverbial closure" 
     26#?rakudo skip "adverbial block" 
    2727{ 
    2828    my @result = @list.grep():{ ($_ % 2) }; 
     
    3535} 
    3636 
    37 #?rakudo skip "adverbial closure" 
     37#?rakudo skip "adverbial block" 
    3838{ 
    3939    my @result = @list.grep :{ ($_ % 2) }; 
     
    4646} 
    4747 
    48 #?rakudo skip "adverbial closure" 
     48#?rakudo skip "closure as non-final argument" 
    4949{ 
    5050    my @result = grep { ($_ % 2) }: @list; 
    51     is(+@result, 5, 'we got a list back');  
    52     is(@result[0], 1, 'got the value we expected');  
    53     is(@result[1], 3, 'got the value we expected');  
    54     is(@result[2], 5, 'got the value we expected');  
    55     is(@result[3], 7, 'got the value we expected');  
    56     is(@result[4], 9, 'got the value we expected');  
     51    is(+@result, 5, 'we got a list back'); 
     52    is(@result[0], 1, 'got the value we expected'); 
     53    is(@result[1], 3, 'got the value we expected'); 
     54    is(@result[2], 5, 'got the value we expected'); 
     55    is(@result[3], 7, 'got the value we expected'); 
     56    is(@result[4], 9, 'got the value we expected'); 
    5757} 
    5858 
    5959# .grep shouldn't work on non-arrays 
     60##  XXX pmichaud, 2008-07-01: 
     61##    p6l says that .grep should work on non-list values. 
    6062{ 
    6163  #?pugs 2 todo 'bug' 
  • t/spec/S29-list/map.t

    r20954 r21162  
    2424} 
    2525 
    26 #?rakudo skip "adverbial closure" 
     26#?rakudo skip "adverbial block" 
    2727{ 
    2828    my @result = @list.map():{ $_ * 2 }; 
     
    4545} 
    4646 
    47 #?rakudo skip "colon invocant syntax" 
     47#?rakudo skip "closure as non-final argument" 
    4848{ 
    4949    my @result = map { $_ * 2 }: @list; 
     
    101101 
    102102# map with n-ary functions 
    103 #?rakudo skip "colon invocant syntax" 
     103#?rakudo skip "adverbial block" 
    104104{ 
    105105  is ~(1,2,3,4).map:{ $^a + $^b             }, "3 7", "map() works with 2-ary functions"; 
     
    110110 
    111111# .map shouldn't work on non-arrays 
     112## XXX pmichaud, 2008-07-01:  .map should work on non-list values 
    112113{ 
    113114  #?pugs 2 todo 'bug' 
    114115  dies_ok { 42.map: { $_ } },    "method form of map should not work on numbers"; 
    115116  dies_ok { "str".map: { $_ } }, "method form of map should not work on strings"; 
    116   #?rakudo skip "colon invocant syntax" 
     117  #?rakudo skip "adverbial block" 
    117118  is ~(42,).map:{ $_ }, "42",   "method form of map should work on arrays"; 
    118119}; 
     
    131132=end pod 
    132133 
    133 #?rakudo skip "colon invocant syntax" 
     134##  XXX pmichaud, 2008-07-01:   As the test is written below, the 
     135##    @expected and "map of ..." arguments are arguments of .map(...) 
     136##    and not of is(...).  See S12:406. 
     137#?rakudo skip "syntax error in test" 
    134138{ 
    135139  my @expected = ("foo","bar"); 
     
    140144 
    141145 
    142 #?rakudo skip "no hashes at the moment" 
     146#?rakudo skip '{} hash composer not implemented' 
    143147{ 
    144148  my @a = (1, 2, 3);  
  • t/spec/S29-list/reduce.t

    r20682 r21162  
    2121 
    2222  is((reduce { $^a + $^b }, 0, @array), $sum, "basic reduce works (1)"); 
    23 #?rakudo 2 skip 'adverbial closure' 
     23#?rakudo skip 'closure as non-final argument' 
    2424  is((reduce { $^a + $^b }: 100, @array), 100 + $sum, "basic reduce works (2)"); 
     25#?rakudo skip 'method fallback to sub unimpl' 
    2526  is(({ $^a * $^b }.reduce: 1,2,3,4,5), 120, "basic reduce works (3)"); 
    2627} 
     
    3536 
    3637# .reduce shouldn't work on non-arrays 
     38##  XXX pmichaud, 2008-07-01:  .reduce should work on non-list values 
    3739{ 
    3840#?pugs 2 todo 'bug' 
     
    4244} 
    4345 
    44 #?rakudo 4 skip 'parsefail' 
     46#?rakudo 4 skip '{} hash composer not implemented' 
    4547{ 
    4648  my $hash = {a => {b => {c => 42}}}; 
  • t/spec/S29-list/sort.t

    r20585 r21162  
    3737} 
    3838 
    39 #?rakudo skip "adverbial closure" 
     39#?rakudo skip "closure as non-final argument" 
    4040{ 
    4141    my @a = (2, 45, 6, 1, 3); 
     
    4343 
    4444    my @s = sort { $^a <=> $^b }: @a; 
    45     is(@s, @e, '... with closure as indirect invocant');  
     45    is(@s, @e, '... with closure as indirect invocant'); 
    4646} 
    4747 
    48 #?rakudo skip "adverbial closure" 
     48#?rakudo skip "method fallback to sub unimpl" 
    4949{ 
    5050    my @a = (2, 45, 6, 1, 3); 
     
    153153 
    154154# .sort shouldn't work on non-arrays 
    155 #?rakudo skip 'adverbial closure' 
     155##  XXX pmichaud, 2008-07-01:  .sort should work on non-list values 
     156#?rakudo skip 'test errors, adverbial block' 
    156157{ 
    157158#?pugs 2 todo 'bug'