Permalink
Browse files

[spec] tests for interpolated sequential alternations ( ||@list )

git-svn-id: http://svn.pugscode.org/pugs@20892 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
moritz
moritz committed Jun 19, 2008
1 parent 002a3d4 commit 3a1ce4c29e69ff30d9d11f79521018993ac8c124
Showing with 16 additions and 1 deletion.
  1. +16 −1 S05-alternation/sequential.t
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 6;
+plan 10;
#L<S05/New metacharacters/"As with the disjunctions | and ||">
@@ -18,3 +18,18 @@ plan 6;
ok $str ~~ m/xxxx||xx||x/;
is ~$/, 'xx', 'second alternative || matches if first fails';
}
+
+#L<S05/"Variable (non-)interpolation"/"An interpolated array:">
+
+{
+ my $str = 'x' x 7;
+ my @list = <x xx xxxx>;
+
+ ok $str ~~ m/ ||@list /;
+ is ~$/, 'x', 'first ||@list alternative matches';
+
+ @list = <xx x xxxx>;
+
+ ok $str ~~ m/ ||@list /;
+ is ~$/, 'xx', 'first ||@list alternative matches';
+}

0 comments on commit 3a1ce4c

Please sign in to comment.