Changeset 24158
- Timestamp:
- 12/05/08 13:08:03 (5 weeks ago)
- Files:
-
- 1 modified
-
t/spec/S05-substitution/match.t (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
t/spec/S05-substitution/match.t
r22290 r24158 3 3 use Test; 4 4 5 plan 9;5 plan 13; 6 6 7 7 # L<S05/Substitution/> … … 9 9 my $str = 'hello'; 10 10 11 12 11 ok $str.match(/h/), 'We can use match'; 13 12 is $str, 'hello', '.. it does not do side effect'; 14 #?rakudo todo 'return Match object, RT #57094'15 13 ok $str.match(/h/)~~Match, '.. it returns a Match object'; 16 14 … … 27 25 # but possibly it should just be defined in object as an exact alias to ~~ ? 28 26 27 $str = 'food'; 28 my $m = $str.match(/$<x>=[f](o+)/); 29 ok $m ~~ Match, 'is a Match object'; 30 is $m, 'foo', 'match object stringifies OK'; 31 is $m<x>, 'f', 'match object indexes as a hash'; 32 is $m[0], 'oo', 'match object indexes as an array';
