Changeset 24158

Show
Ignore:
Timestamp:
12/05/08 13:08:03 (5 weeks ago)
Author:
jnthn
Message:

[t/spec] Unfudge a .match test for Rakudo and add a few more.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • t/spec/S05-substitution/match.t

    r22290 r24158  
    33use Test; 
    44 
    5 plan 9; 
     5plan 13; 
    66 
    77# L<S05/Substitution/> 
     
    99my $str = 'hello'; 
    1010 
    11  
    1211ok $str.match(/h/),         'We can use match'; 
    1312is $str,  'hello',          '.. it does not do side effect'; 
    14 #?rakudo todo 'return Match object, RT #57094' 
    1513ok $str.match(/h/)~~Match,  '.. it returns a Match object'; 
    1614 
     
    2725# but possibly it should just be defined in object as an exact alias to ~~ ? 
    2826 
     27$str = 'food'; 
     28my $m = $str.match(/$<x>=[f](o+)/); 
     29ok $m ~~ Match,             'is a Match object'; 
     30is $m,    'foo',            'match object stringifies OK'; 
     31is $m<x>, 'f',              'match object indexes as a hash'; 
     32is $m[0], 'oo',             'match object indexes as an array';