Skip to content

Commit d8d3a15

Browse files
committed
ensure << a b c 'x' >> doesn't parcelize <a b c>
1 parent b2ffd2f commit d8d3a15

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

S02-literals/quoting.t

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use v6;
22
use Test;
3-
plan 162;
3+
plan 170;
44

55
my $foo = "FOO";
66
my $bar = "BAR";
@@ -269,11 +269,26 @@ Note that non-ASCII tests are kept in quoting-unicode.t
269269
270270
@q2 = «$foo "$gorch" '$bar'»;
271271
#?niecza 3 todo
272-
is(+@q2, 3, "3 elementes in sub quoted «» list");
272+
is(+@q2, 3, "3 elements in sub quoted «» list");
273273
is(@q2[1], $gorch, 'second element is both parts of $gorch, interpolated');
274274
is(@q2[2], '$bar', 'single quoted $bar was not interpolated');
275275
};
276276
277+
# non-flattening context still counts adjacent non-quoted words separately
278+
#?niecza todo
279+
{
280+
my $gorch = "foo bar";
281+
my @q := «a b c "$foo" f g $gorch m n '$bar' x y z»;
282+
is(+@q, 13, "13 elements in mixed quoted/unquoted «» list, non-flattened");
283+
is(@q[0], 'a', 'unquoted words are split correctly in the presence of quotes');
284+
is(@q[3], $foo, 'first interpolation is $foo');
285+
is(@q[4], 'f', 'unquoted between quotes is split correctly');
286+
is(@q[6], $gorch, 'second quote is both parts of $gorch interpolated as sublist in non-flat context');
287+
is(@q[8], 'n', 'unquoted between quotes is split correctly');
288+
is(@q[9], '$bar', 'single quoted $bar was not interpolated');
289+
is(@q[12], 'z', 'trailing unquoted words are split correctly in the presence of quotes');
290+
};
291+
277292
{ # Q L<S02/Literals/No escapes at all>
278293
my @q = ();
279294

0 commit comments

Comments
 (0)