|
1 | 1 | use v6;
|
2 | 2 | use Test;
|
3 |
| -plan 162; |
| 3 | +plan 170; |
4 | 4 |
|
5 | 5 | my $foo = "FOO";
|
6 | 6 | my $bar = "BAR";
|
@@ -269,11 +269,26 @@ Note that non-ASCII tests are kept in quoting-unicode.t
|
269 | 269 |
|
270 | 270 | @q2 = «$foo "$gorch" '$bar'»;
|
271 | 271 | #?niecza 3 todo
|
272 |
| - is(+@q2, 3, "3 elementes in sub quoted «» list"); |
| 272 | + is(+@q2, 3, "3 elements in sub quoted «» list"); |
273 | 273 | is(@q2[1], $gorch, 'second element is both parts of $gorch, interpolated');
|
274 | 274 | is(@q2[2], '$bar', 'single quoted $bar was not interpolated');
|
275 | 275 | };
|
276 | 276 |
|
| 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 | +
|
277 | 292 | { # Q L<S02/Literals/No escapes at all>
|
278 | 293 | my @q = ();
|
279 | 294 |
|
|
0 commit comments