Changeset 21162
- Timestamp:
- 07/02/08 06:01:18 (3 months ago)
- Location:
- t/spec/S29-list
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
t/spec/S29-list/grep.t
r21138 r21162 24 24 } 25 25 26 #?rakudo skip "adverbial closure"26 #?rakudo skip "adverbial block" 27 27 { 28 28 my @result = @list.grep():{ ($_ % 2) }; … … 35 35 } 36 36 37 #?rakudo skip "adverbial closure"37 #?rakudo skip "adverbial block" 38 38 { 39 39 my @result = @list.grep :{ ($_ % 2) }; … … 46 46 } 47 47 48 #?rakudo skip " adverbial closure"48 #?rakudo skip "closure as non-final argument" 49 49 { 50 50 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'); 57 57 } 58 58 59 59 # .grep shouldn't work on non-arrays 60 ## XXX pmichaud, 2008-07-01: 61 ## p6l says that .grep should work on non-list values. 60 62 { 61 63 #?pugs 2 todo 'bug' -
t/spec/S29-list/map.t
r20954 r21162 24 24 } 25 25 26 #?rakudo skip "adverbial closure"26 #?rakudo skip "adverbial block" 27 27 { 28 28 my @result = @list.map():{ $_ * 2 }; … … 45 45 } 46 46 47 #?rakudo skip "c olon invocant syntax"47 #?rakudo skip "closure as non-final argument" 48 48 { 49 49 my @result = map { $_ * 2 }: @list; … … 101 101 102 102 # map with n-ary functions 103 #?rakudo skip " colon invocant syntax"103 #?rakudo skip "adverbial block" 104 104 { 105 105 is ~(1,2,3,4).map:{ $^a + $^b }, "3 7", "map() works with 2-ary functions"; … … 110 110 111 111 # .map shouldn't work on non-arrays 112 ## XXX pmichaud, 2008-07-01: .map should work on non-list values 112 113 { 113 114 #?pugs 2 todo 'bug' 114 115 dies_ok { 42.map: { $_ } }, "method form of map should not work on numbers"; 115 116 dies_ok { "str".map: { $_ } }, "method form of map should not work on strings"; 116 #?rakudo skip " colon invocant syntax"117 #?rakudo skip "adverbial block" 117 118 is ~(42,).map:{ $_ }, "42", "method form of map should work on arrays"; 118 119 }; … … 131 132 =end pod 132 133 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" 134 138 { 135 139 my @expected = ("foo","bar"); … … 140 144 141 145 142 #?rakudo skip "no hashes at the moment"146 #?rakudo skip '{} hash composer not implemented' 143 147 { 144 148 my @a = (1, 2, 3); -
t/spec/S29-list/reduce.t
r20682 r21162 21 21 22 22 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' 24 24 is((reduce { $^a + $^b }: 100, @array), 100 + $sum, "basic reduce works (2)"); 25 #?rakudo skip 'method fallback to sub unimpl' 25 26 is(({ $^a * $^b }.reduce: 1,2,3,4,5), 120, "basic reduce works (3)"); 26 27 } … … 35 36 36 37 # .reduce shouldn't work on non-arrays 38 ## XXX pmichaud, 2008-07-01: .reduce should work on non-list values 37 39 { 38 40 #?pugs 2 todo 'bug' … … 42 44 } 43 45 44 #?rakudo 4 skip ' parsefail'46 #?rakudo 4 skip '{} hash composer not implemented' 45 47 { 46 48 my $hash = {a => {b => {c => 42}}}; -
t/spec/S29-list/sort.t
r20585 r21162 37 37 } 38 38 39 #?rakudo skip " adverbial closure"39 #?rakudo skip "closure as non-final argument" 40 40 { 41 41 my @a = (2, 45, 6, 1, 3); … … 43 43 44 44 my @s = sort { $^a <=> $^b }: @a; 45 is(@s, @e, '... with closure as indirect invocant'); 45 is(@s, @e, '... with closure as indirect invocant'); 46 46 } 47 47 48 #?rakudo skip " adverbial closure"48 #?rakudo skip "method fallback to sub unimpl" 49 49 { 50 50 my @a = (2, 45, 6, 1, 3); … … 153 153 154 154 # .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' 156 157 { 157 158 #?pugs 2 todo 'bug'
