Skip to content

Commit

Permalink
Test Str.trans with anchored regex, and with look-behind regex
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Oct 11, 2014
1 parent 42fdb20 commit 52de4a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion S05-transliteration/trans.t
Expand Up @@ -10,7 +10,7 @@ String transliteration

# L<S05/Transliteration>

plan 60;
plan 62;

is("ABC".trans( ('A'=>'a'), ('B'=>'b'), ('C'=>'c') ),
"abc",
Expand Down Expand Up @@ -260,6 +260,9 @@ is('ababab'.trans([/ab/, 'aba', 'bab', /baba/] =>
'23',
'longest token still holds, even between constant strings and regexes');

is 'aa'.trans(/^a/ => 'b'), 'ba', 'trans with anchored regex';
is 'aa'.trans(/ <after a> ./ => 'b'), 'ab', 'trans with look-around regex';

# RT #83674
#?niecza todo 'Not sure what is supposed to be going on here'
lives_ok { my @a = 1..2; @a>>.trans((1..2) => (14..15,1..2)); }, 'trans works with Cool signature';
Expand Down

0 comments on commit 52de4a2

Please sign in to comment.