Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
new test file for regex-delims, RT #117415
  • Loading branch information
FROGGS committed May 17, 2013
1 parent 86f678d commit 8387137
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions S05-metasyntax/delimiters.t
@@ -0,0 +1,20 @@

use Test;

plan 23;

# L<S05/Regexes constitute a first-class language, rather than just being strings/can take (almost) any chars as delimiters>

my @delims = < ^ ° ! " § $ % @ € & / = ? ` * + ~ ' ; , . - | >;
my %todo;

#?niecza emit %todo = < ? 1 * 1 + 1 ~ 1 ' 1 - 1 >;

for @delims -> $d {
my $ok = try { eval("my \$x = 'abc'; \$x ~~ m{$d}b{$d}") };
my $nok = try { eval("my \$x = 'abc'; \$x ~~ m{$d}d{$d}") };
my $is = try { eval("my \$x = 'abc'; \$x ~~ s{$d}a{$d}b{$d}; \$x") } eq 'bbc';

todo "$d not yet supported" if %todo{$d};
ok $ok && !$nok && $is, "$d as delimiter in match and substitution";
}

0 comments on commit 8387137

Please sign in to comment.