Changeset 21160 for t/spec/S29-list/first.t
- Timestamp:
- 07/02/08 04:24:47 (5 months ago)
- Files:
-
- 1 modified
-
t/spec/S29-list/first.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
t/spec/S29-list/first.t
r20685 r21160 26 26 } 27 27 28 #?rakudo skip " colon invocant syntax"28 #?rakudo skip "adverbial closure" 29 29 { 30 30 my $result = @list.first():{ ($_ == 4) }; … … 34 34 35 35 { 36 is(@list.first( { ($_ == 11) }), undef, 'first returns undef unsuccessfull match');36 is(@list.first( { ($_ == 11) }), undef, 'first returns undef unsuccessfull match'); 37 37 } 38 38 39 39 { 40 my $count = 0; 41 my $matcher = sub (Int $x) { $count++; $x % 2 }; 42 is(@list.first($matcher), 1, 'first() search for odd elements successfull'); 43 is($count, 1, 'Matching closure in first() is only executed once'); 44 40 my $count = 0; 41 my $matcher = sub (Int $x) { $count++; $x % 2 }; 42 is(@list.first($matcher), 1, 'first() search for odd elements successfull'); 43 is($count, 1, 'Matching closure in first() is only executed once'); 45 44 }
