Changeset 22021
- Timestamp:
- 08/23/08 12:19:03 (3 months ago)
- Location:
- t/spec/S05-substitution
- Files:
-
- 1 added
- 1 moved
-
. (added)
-
subst.t (moved) (moved from t/builtins/strings/subst.t) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
t/spec/S05-substitution/subst.t
r21867 r22021 5 5 plan 12; 6 6 7 # L<S05/Substitution/> 7 8 8 9 my $str = 'hello'; … … 10 11 is $str.subst(/h/,'f'), 'fello', 'We can use subst'; 11 12 is $str, 'hello', '.. withouth side effect'; 12 #?rakudo eval"multiple adverbs not implemented"13 #?rakudo skip "multiple adverbs not implemented" 13 14 is $str.subst(rx:g:i/L/,'p'), 'heppo', '.. with multiple adverbs'; 14 15 … … 19 20 #?rakudo eval "subst with a block parameter not implemented" 20 21 is $str.subst(/l/,{$i++}), 'he0lo', 'We can have a closure as replacement'; 21 #?rakudo eval"multiple adverbs not implemented"22 #?rakudo skip "multiple adverbs not implemented" 22 23 is $str.subst(rx:g/l/,{$i++}),'he12o', '.. which act like closure and can be called more then once'; 23 #?rakudo eval"rakudo doesn't like dotty methods [perl #57740]"24 #?rakudo skip "rakudo doesn't like dotty methods [perl #57740]" 24 25 is $str.=subst(/l/,'i'), 'heilo', '.. and with the .= modifier'; 25 #?rakudo eval "skipped because the one before was skipped"26 #?rakudo skip "(test dependency)" 26 27 is $str, 'heilo', '.. it changes the receiver'; 27 28 28 29 # not sure about this. Maybe '$1$0' should work. 29 30 30 #?rakudo eval '$/ not involved in .subst yet'31 #?rakudo 3 skip '$/ not involved in .subst yet (unspecced?)' 31 32 is 'a'.subst(/(.)/,"$1$0"), '', '.. and it can not access captures from strings'; 32 #?rakudo eval '$/ not involved in .subst yet'33 33 is 'a'.subst(/(.)/,{$0~$0}),'aa', '.. you must wrap it in a closure'; 34 #?rakudo eval '$/ not involved in .subst yet'35 34 is '12'.subst(/(.)(.)/,{$()*2}),'24', '.. and do nifty things in closures'; 36 35
