Skip to content

Commit 872ca4c

Browse files
committed
Add 10 more q and qq quote tests
1 parent 57453ad commit 872ca4c

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

t/nqp/038-quotes.t

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# interpolating quotes
44

5-
plan(7);
5+
plan(17);
66

77
my $abc := 'abc';
88

@@ -14,8 +14,19 @@ my $num := 5;
1414

1515
is( "xxx {3+$num} zzz", 'xxx 8 zzz', "basic closure interpolation" );
1616

17-
is( qq{xxx {3+$num} zzz}, 'xxx 8 zzz', 'basic qq{} closure interpolation' );
17+
is( qq{$abc xxx {3+$num} zzz$num}, 'abc xxx 8 zzz5', 'qq{} closure interpolation' );
18+
is( qq ($abc xxx {3+$num} zzz$num), 'abc xxx 8 zzz5', 'qq () closure interpolation' );
19+
is( qq/$abc xxx {3+$num} zzz$num/, 'abc xxx 8 zzz5', 'qq// closure interpolation' );
1820

21+
is( q{$abc xxx {3+$num} zzz}, '$abc xxx {3+$num} zzz', 'basic q{} closure without interpolation' );
22+
is( q ($abc xxx {3+$num} zzz), '$abc xxx {3+$num} zzz', 'basic q () closure without interpolation' );
23+
is( q/$abc xxx {3+$num} zzz/, '$abc xxx {3+$num} zzz', 'basic q// closure without interpolation' );
24+
25+
is( q ($hi), '$hi', "basic q () doesn't interpolate.");
26+
is( q/$hi/, '$hi', "basic q// doesn't interpolate.");
27+
is( q{$hi}, '$hi', "basic q{} doesn't interpolate.");
28+
is( q ($num), '$num', "basic q () doesn't interpolate.");
29+
is( q/$num/, '$num', "basic q// doesn't interpolate.");
1930
is( < a >, 'a', 'spaces around individual element stripped');
2031

2132
ok( +< a b > == 2, 'angle quotes correctly produce list');

0 commit comments

Comments
 (0)