Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 597 lines (501 sloc) 16.315 kb
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
1 use v6;
2 use Test;
8cc349a8 »
2011-07-11 some fudging of S02-literals/quoting, S04-declarations/{my, state}; f…
3 plan 152;
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
4
5 my $foo = "FOO";
6 my $bar = "BAR";
7
8 =begin description
9
10 Tests quoting constructs as defined in L<S02/Literals>
11
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
12 Note that non-ASCII tests are kept in quoting-unicode.t
13
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
14 =todo
15
8c8fd132 »
2008-09-11 [t/spec] many test fixes, mostly related to undef
16 * q:b and other interpolation levels (half-done)
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
17 * meaningful quotations (qx, rx, etc)
18 * interpolation of scalar, array, hash, function and closure syntaxes
19 * q : a d verb s // parsing
20
21 =end description
22
cfb4a0de »
2011-08-13 fix a few smartlinks
23 # L<S02/Bracketing Characters/bidirectional mirrorings>
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
24 {
25 my $s = q{ foo bar };
26 is $s, ' foo bar ', 'string using q{}';
27 }
28
29 {
734bc95b »
2009-03-29 [t/spec]
30 #?rakudo skip 'nested curlies in q{...}'
a3ac3867 »
2008-09-11 [t/spec] more quoting test[t/spec] more quoting testss
31 is q{ { foo } }, ' { foo } ', 'Can nest curlies in q{ .. }';
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
32 is q{{ab}}, 'ab', 'Unnested single curlies in q{{...}}';
a3ac3867 »
2008-09-11 [t/spec] more quoting test[t/spec] more quoting testss
33 is q{{ fo} }}, ' fo} ', 'Unnested single curlies in q{{...}}';
734bc95b »
2009-03-29 [t/spec]
34 #?rakudo skip 'nested double curlies in q{{...}}'
a3ac3867 »
2008-09-11 [t/spec] more quoting test[t/spec] more quoting testss
35 is q{{ {{ } }} }}, ' {{ } }} ', 'Can nest double curlies in q{{...}}';
36 }
37
38 {
ade52657 »
2008-09-11 [t/spec] more and corrected quoting tests
39 is q{\n}, '\n', 'q{..} do not interpolate \n';
40 ok q{\n}.chars == 2, 'q{..} do not interpolate \n';
41 is q{$x}, '$x', 'q{..} do not interpolate scalars';
42 ok q{$x}.chars == 2, 'q{..} do not interpolate scalars';
43 }
44
9dac81d1 »
2012-03-02 pugs fudge
45 #?pugs skip 'parsefail'
ade52657 »
2008-09-11 [t/spec] more and corrected quoting tests
46 {
47 is Q{\n}, '\n', 'Q{..} do not interpolate \n';
48 ok Q{\n}.chars == 2, 'Q{..} do not interpolate \n';
49 is Q{$x}, '$x', 'Q{..} do not interpolate scalars';
50 ok Q{$x}.chars == 2, 'Q{..} do not interpolate scalars';
8c8fd132 »
2008-09-11 [t/spec] many test fixes, mostly related to undef
51 is Q {\\}, '\\\\', 'Q {..} quoting';
ade52657 »
2008-09-11 [t/spec] more and corrected quoting tests
52 }
53
9dac81d1 »
2012-03-02 pugs fudge
54 #?pugs skip 'parsefail'
ade52657 »
2008-09-11 [t/spec] more and corrected quoting tests
55 {
56 ok Q{\\}.chars == 2, 'Q{..} do not interpolate backslashes';
a3ac3867 »
2008-09-11 [t/spec] more quoting test[t/spec] more quoting testss
57 }
58
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
59 # L<S02/Adverbs on quotes/":q" ":single" "Interpolate \\, \q and \'">
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
60 {
61 my @q = ();
62 @q = (q/$foo $bar/);
63 is(+@q, 1, 'q// is singular');
64 is(@q[0], '$foo $bar', 'single quotes are non interpolating');
65 };
66
44ee2e8f »
2008-07-19 [various test files] fixed a few spelling errors and a missing semicolon
67 { # and its complement ;-)
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
68 my @q = ();
69 @q = '$foo $bar';
70 is(+@q, 1, "'' is singular");
71 is(@q[0], '$foo $bar', 'and did not interpolate either');
72 };
73
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
74 # L<S02/Delimiters of quoting forms/That is () have no special significance>
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
75 # non interpolating single quotes with nested parens
76 {
77 my @q = ();
78 @q = (q (($foo $bar)));
79 is(+@q, 1, 'q (()) is singular');
80 is(@q[0], '$foo $bar', 'and nests parens appropriately');
81 };
82
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
83 # L<S02/Delimiters of quoting forms/That is () have no special significance>
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
84 #?rakudo skip 'quoting with q (..)'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
85 { # non interpolating single quotes with nested parens
86 my @q = ();
87 @q = (q ( ($foo $bar)));
88 is(+@q, 1, 'q () is singular');
89 is(@q[0], ' ($foo $bar)', 'and nests parens appropriately');
90 };
91
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
92 # L<S02/Delimiters of quoting forms/Which is mandatory for parens>
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
93 { # q() is bad
94 my @q;
95 sub q { @_ }
96 @q = q($foo,$bar);
97 is(+@q, 2, 'q() is always sub call');
98 };
99
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
100 # L<S02/C<Q> forms/:q>
d279be16 »
2010-03-06 [t/spec] re-fudge quoting.t for rakudo
101 #?rakudo skip 'Q:q adverbs'
9dac81d1 »
2012-03-02 pugs fudge
102 #?pugs skip 'parsefail'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
103 { # adverb variation
104 my @q = ();
e4e5f056 »
2008-07-18 [STD] handle Q forms
105 @q = (Q:q/$foo $bar/);
106 is(+@q, 1, "Q:q// is singular");
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
107 is(@q[0], '$foo $bar', "and again, non interpolating");
108 };
109
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
110 #?rakudo skip 'nested bracket quotes'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
111 { # nested brackets
112 my @q = ();
113 @q = (q[ [$foo $bar]]);
114 is(+@q, 1, 'q[] is singular');
115 is(@q[0], ' [$foo $bar]', 'and nests brackets appropriately');
116 };
117
118 { # nested brackets
119 my @q = ();
120 @q = (q[[$foo $bar]]);
121 is(+@q, 1, 'q[[]] is singular');
122 is(@q[0], '$foo $bar', 'and nests brackets appropriately');
123 };
124
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
125 # L<S02/C<Q> forms/qq:>
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
126 { # interpolating quotes
127 my @q = ();
128 @q = qq/$foo $bar/;
129 is(+@q, 1, 'qq// is singular');
130 is(@q[0], 'FOO BAR', 'variables were interpolated');
131 };
132
133 { # "" variation
134 my @q = ();
135 @q = "$foo $bar";
136 is(+@q, 1, '"" is singular');
137 is(@q[0], "FOO BAR", '"" interpolates');
138 };
139
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
140 # L<S02/C<Q> forms/:qq>
d279be16 »
2010-03-06 [t/spec] re-fudge quoting.t for rakudo
141 #?rakudo skip 'Q:qq adverbs'
9dac81d1 »
2012-03-02 pugs fudge
142 #?pugs skip 'parsefail'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
143 { # adverb variation
144 my @q = ();
e4e5f056 »
2008-07-18 [STD] handle Q forms
145 @q = Q:qq/$foo $bar/;
146 is(+@q, 1, "Q:qq// is singular");
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
147 is(@q[0], "FOO BAR", "blah blah interp");
148 };
149
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
150 # L<S02/Interpolating into a single-quoted string/using the \qq>
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
151 #?rakudo skip 'q[..] with variations'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
152 { # \qq[] constructs interpolate in q[]
e359fbb6 »
2008-11-26 [t/spec] my() is a function call
153 my ( @q1, @q2, @q3, @q4 ) = ();
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
154 @q1 = q[$foo \qq[$bar]];
155 is(+@q1, 1, "q[...\\qq[...]...] is singular");
156 is(@q1[0], '$foo BAR', "and interpolates correctly");
157
158 @q2 = '$foo \qq[$bar]';
159 is(+@q2, 1, "'...\\qq[...]...' is singular");
160 is(@q2[0], '$foo BAR', "and interpolates correctly");
161
162 @q3 = q[$foo \q:s{$bar}];
163 is(+@q3, 1, 'q[...\\q:s{...}...] is singular');
164 is(@q3[0], '$foo BAR', "and interpolates correctly");
165
166 @q4 = q{$foo \q/$bar/};
167 is(+@q4, 1, 'q{...\\q/.../...} is singular');
168 is(@q4[0], '$foo $bar', "and interpolates correctly");
169 }
170
8cc349a8 »
2011-07-11 some fudging of S02-literals/quoting, S04-declarations/{my, state}; f…
171 # quote with \0 as delimiters, forbidden by STD
172 # but see L<news:20050101220112.GF25432@plum.flirble.org>
1cc6e47c »
2012-04-25 rakudo (auto) (un)fudge
173 #?rakudo todo 'retriage'
9dac81d1 »
2012-03-02 pugs fudge
174 #?pugs todo
8cc349a8 »
2011-07-11 some fudging of S02-literals/quoting, S04-declarations/{my, state}; f…
175 {
176 eval_dies_ok "(q\0foo bar\0)";
177 }
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
178
179 { # traditional quote word
180 my @q = ();
181 @q = (qw/$foo $bar/);
182 is(+@q, 2, "qw// is plural");
183 is(@q[0], '$foo', "and non interpolating");
184 is(@q[1], '$bar', "...");
185 };
186
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
187 # L<S02/Quoting forms/quote operator now has a bracketed form>
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
188 { # angle brackets
189 my @q = ();
190 @q = <$foo $bar>;
191 is(+@q, 2, "<> behaves the same way");
192 is(@q[0], '$foo', 'for interpolation too');
193 is(@q[1], '$bar', '...');
194 };
195
196 { # angle brackets
197 my @q = ();
198 @q = < $foo $bar >;
199 is(+@q, 2, "<> behaves the same way, with leading (and trailing) whitespace");
200 is(@q[0], '$foo', 'for interpolation too');
201 is(@q[1], '$bar', '...');
202 };
203
d279be16 »
2010-03-06 [t/spec] re-fudge quoting.t for rakudo
204 #?rakudo skip 'q:w'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
205 { # adverb variation
206 my @q = ();
207 @q = (q:w/$foo $bar/);
208 is(+@q, 2, "q:w// is like <>");
209 is(@q[0], '$foo', "...");
210 is(@q[1], '$bar', "...");
211 };
212
d279be16 »
2010-03-06 [t/spec] re-fudge quoting.t for rakudo
213 #?rakudo skip 'q:w'
189b4dbe »
2009-05-06 [t/spec] cosmetic cleaning: remove trailing space
214 { # whitespace sep aration does not break quote constructor
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
215 # L<S02/Whitespace before adverbs/Whitespace is allowed between the "q" and its adverb: q :w /.../.>
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
216 my @q = ();
217 @q = (q :w /$foo $bar/);
218 is(+@q, 2, "q :w // is the same as q:w//");
219 is(@q[0], '$foo', "...");
220 is(@q[1], '$bar', "...");
221 };
222
223
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
224 #?rakudo skip 'quoting with adverbs'
189b4dbe »
2009-05-06 [t/spec] cosmetic cleaning: remove trailing space
225 { # qq:w,Interpolating quote constructor with words adverb
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
226 # L<S02/Adverbs on quotes/"Split result on words (no quote protection)">
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
227 my (@q1, @q2) = ();
228 @q1 = qq:w/$foo "gorch $bar"/;
229 @q2 = qq:words/$foo "gorch $bar"/;
230
231 is(+@q1, 3, 'qq:w// correct number of elements');
232 is(+@q2, 3, 'qq:words correct number of elements');
233
234 is(~@q1, 'FOO "gorch BAR"', "explicit quote word interpolates");
235 is(~@q2, 'FOO "gorch BAR"', "long form output is the same as the short");
236 };
237
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
238 #?rakudo skip 'quoting with adverbs'
4bdf17ed »
2011-09-29 Convert niecza faux-todo to real todo.
239 #?niecza todo
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
240 { # qq:ww, interpolating L<S02/Literals/double angles do interpolate>
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
241 # L<S02/Forcing item context/"implicit split" "shell-like fashion">
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
242 my (@q1, @q2, @q3, @q4) = ();
243 @q1 = qq:ww/$foo "gorch $bar"/;
244 @q2 = «$foo "gorch $bar"»; # french
245 @q3 = <<$foo "gorch $bar">>; # texas
246 @q4 = qq:quotewords/$foo "gorch $bar"/; # long
247
248 is(+@q1, 2, 'qq:ww// correct number of elements');
249 is(+@q2, 2, 'french double angle');
250 is(+@q3, 2, 'texas double angle');
251 is(+@q4, 2, 'long form');
252
253 is(~@q1, 'FOO gorch BAR', "explicit quote word interpolates");
254 is(~@q2, 'FOO gorch BAR', "output is the same as french");
255
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
256 # L<S02/Adverbs on quotes/"the built-in «...» quoter automatically does interpolation equivalent to qq:ww/.../">
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
257 is(~@q3, 'FOO gorch BAR', ", texas quotes");
258 is(~@q4, 'FOO gorch BAR', ", and long form");
259 };
260
d279be16 »
2010-03-06 [t/spec] re-fudge quoting.t for rakudo
261 #?rakudo skip 'RT 65654'
b25d4305 »
2009-10-27 [t/spec] Test for RT 65654
262 {
263 my $rt65654 = 'two words';
264 is «a $rt65654 z».elems, 4, 'interpolate variable with spaces (French)';
265 is <<a $rt65654 z>>.elems, 4, 'interpolate variable with spaces (Texas)';
266 }
267
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
268 #?rakudo skip '«...»'
4bdf17ed »
2011-09-29 Convert niecza faux-todo to real todo.
269 #?niecza todo
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
270 {
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
271 #L<S02/Forcing item context/"relationship" "single quotes" "double angles">
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
272 # Pugs was having trouble with this. Fixed in r12785.
273 my ($x, $y) = <a b>;
274 ok(«$x $y» === <a b>, "«$x $y» interpolation works correctly");
275 };
276
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
277
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
278 # L<S02/Forcing item context/respects quotes in a shell-like fashion>
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
279 #?rakudo skip '«...»'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
280 { # qw, interpolating, shell quoting
281 my (@q1, @q2) = ();
282 my $gorch = "foo bar";
283
284 @q1 = «$foo $gorch $bar»;
285 is(+@q1, 4, "4 elements in unquoted «» list");
286 is(@q1[2], "bar", '$gorch was exploded');
287 is(@q1[3], "BAR", '$bar was interpolated');
288
289 @q2 = «$foo "$gorch" '$bar'»;
bd0cef4f »
2011-09-29 niecza fudging.
290 #?niecza 3 todo
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
291 is(+@q2, 3, "3 elementes in sub quoted «» list");
292 is(@q2[1], $gorch, 'second element is both parts of $gorch, interpolated');
293 is(@q2[2], '$bar', 'single quoted $bar was not interpolated');
294 };
295
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
296 # L<S02/Heredocs/Heredocs are no longer written>
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
297 #?rakudo skip 'quoting with adverbs'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
298 { # qq:to
299 my @q = ();
300
301 @q = qq:to/FOO/;
302 blah
303 $bar
304 blah
305 $foo
306 FOO
307
308 is(+@q, 1, "q:to// is singular");
309 is(@q[0], "blah\nBAR\nblah\nFOO\n", "here doc interpolated");
310 };
311
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
312 # L<S02/Optional whitespace/Heredocs allow optional whitespace>
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
313 #?rakudo skip 'quoting with adverbs'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
314 { # q:to indented
315 my @q = ();
316
317 @q = q:to/FOO/;
318 blah blah
319 $foo
320 FOO
321
322 is(+@q, 1, "q:to// is singular, also when indented");
323 is(@q[0], "blah blah\n\$foo\n", "indentation stripped");
324 };
325
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
326 #?rakudo skip 'heredocs'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
327 { # q:heredoc backslash bug
328 my @q = q:heredoc/FOO/
329 yoink\n
330 splort\\n
331 FOO
332 ;
333 is(+@q, 1, "q:heredoc// is singular");
334 is(@q[0], "yoink\\n\nsplort\\n\n", "backslashes");
335 }
336
9dac81d1 »
2012-03-02 pugs fudge
337 #?pugs skip 'parsefail'
aecba654 »
2008-07-26 [STD] fix heredocs, improve $0 reporting
338 { # Q L<S02/Literals/No escapes at all>
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
339 my @q = ();
189b4dbe »
2009-05-06 [t/spec] cosmetic cleaning: remove trailing space
340
aecba654 »
2008-07-26 [STD] fix heredocs, improve $0 reporting
341 @q = (Q/foo\\bar$foo/);
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
342
aecba654 »
2008-07-26 [STD] fix heredocs, improve $0 reporting
343 is(+@q, 1, "Q// is singular");
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
344 is(@q[0], "foo\\\\bar\$foo", "special chars are meaningless"); # double quoting is to be more explicit
345 };
346
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
347 # L<S02/Forcing item context/"Pair" notation is also recognized inside>
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
348 {
349 # <<:Pair>>
350 my @q = <<:p(1)>>;
4ab919db »
2009-10-10 [t/spec] Mark test for RT #65304
351 #?rakudo 2 todo '<< :pair(1) >> (RT 65304)'
4bdf17ed »
2011-09-29 Convert niecza faux-todo to real todo.
352 #?niecza todo
9dac81d1 »
2012-03-02 pugs fudge
353 #?pugs todo
3d92dde5 »
2009-04-17 [t/spec] some unfudges for Rakudo
354 is(@q[0].perl, (:p(1)).perl, "pair inside <<>>-quotes - simple");
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
355
356 @q = <<:p(1) junk>>;
4bdf17ed »
2011-09-29 Convert niecza faux-todo to real todo.
357 #?niecza todo
9dac81d1 »
2012-03-02 pugs fudge
358 #?pugs todo
3d92dde5 »
2009-04-17 [t/spec] some unfudges for Rakudo
359 is(@q[0].perl, (:p(1)).perl, "pair inside <<>>-quotes - with some junk");
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
360 is(@q[1], 'junk', "pair inside <<>>-quotes - junk preserved");
361
362 @q = <<:def>>;
3d92dde5 »
2009-04-17 [t/spec] some unfudges for Rakudo
363 #?rakudo 2 todo '<< :pair(1) >>'
4bdf17ed »
2011-09-29 Convert niecza faux-todo to real todo.
364 #?niecza todo
9dac81d1 »
2012-03-02 pugs fudge
365 #?pugs todo
3d92dde5 »
2009-04-17 [t/spec] some unfudges for Rakudo
366 is(@q[0].perl, (def => 1).perl, ":pair in <<>>-quotes with no explicit value");
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
367
368 @q = "(eval failed)";
369 try { eval '@q = <<:p<moose>>>;' };
4bdf17ed »
2011-09-29 Convert niecza faux-todo to real todo.
370 #?niecza todo
9dac81d1 »
2012-03-02 pugs fudge
371 #?pugs todo
3d92dde5 »
2009-04-17 [t/spec] some unfudges for Rakudo
372 is(@q[0].perl, (p => "moose").perl, ":pair<anglequoted>");
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
373 };
374
d279be16 »
2010-03-06 [t/spec] re-fudge quoting.t for rakudo
375 #?rakudo skip '\c97 etc'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
376 { # weird char escape sequences
aecba654 »
2008-07-26 [STD] fix heredocs, improve $0 reporting
377 is("\c97", "a", '\c97 is "a"');
378 is("\c102oo", "foo", '\c102 is "f", works next to other letters');
2522422d »
2009-04-24 remove rakudo skip
379
380 is("\c123", chr(123), '"\cXXX" and chr XXX are equivalent');
aecba654 »
2008-07-26 [STD] fix heredocs, improve $0 reporting
381 is("\c[12]3", chr(12) ~ "3", '\c[12]3 is the same as chr(12) concatenated with "3"');
382 is("\c[12] 3", chr(12) ~ " 3", 'respects spaces when interpolating a space character');
383 is("\c[13,10]", chr(13) ~ chr(10), 'allows multiple chars');
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
384
385 is("\x41", "A", 'hex interpolation - \x41 is "A"');
386 is("\o101", "A", 'octal interpolation - \o101 is also "A"' );
387
388 is("\c@", "\0", 'Unicode code point "@" converts correctly to "\0"');
9a5fb1f6 »
2009-04-24 change chr() to one positional parameter
389 is("\cA", chr(1), 'Unicode "A" is #1!');
390 is("\cZ", chr(26), 'Unicode "Z" is chr 26 (or \c26)');
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
391 }
392
393 { # simple test for nested-bracket quoting, per S02
394 my $hi = q<<hi>>;
395 is($hi, "hi", 'q<<hi>> is "hi"');
396 }
397
cf5e1b3d »
2009-06-24 [t/spec] Move a misplaced test.
398 #?rakudo skip 'Thinks statement not terminated properly'
afcdfa29 »
2011-01-31 track RT#
399 is( q<< <<woot>> >>, ' <<woot>> ', 'nested <<texas>> quotes (RT #66888)' );
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
400
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
401 # L<S02/Adverbs on quotes/"for user-defined quotes">
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
402 # q:to
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
403 #?rakudo skip 'quoting with adverbs'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
404 {
405 my $t;
406 $t = q:to /STREAM/;
407 Hello, World
408 STREAM
409
410 is $t, "Hello, World\n", "Testing for q:to operator.";
411
412 $t = q:to /结束/;
413 Hello, World
414 结束
415
416 is $t, "Hello, World\n", "Testing for q:to operator. (utf8)";
417 }
418
aecba654 »
2008-07-26 [STD] fix heredocs, improve $0 reporting
419 # Q
9dac81d1 »
2012-03-02 pugs fudge
420 #?pugs skip 'Q'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
421 {
8cc349a8 »
2011-07-11 some fudging of S02-literals/quoting, S04-declarations/{my, state}; f…
422 my $s1 = "hello"; #OK not used
aecba654 »
2008-07-26 [STD] fix heredocs, improve $0 reporting
423 my $t1 = Q /$s1, world/;
424 is $t1, '$s1, world', "Testing for Q operator.";
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
425
8cc349a8 »
2011-07-11 some fudging of S02-literals/quoting, S04-declarations/{my, state}; f…
426 my $s2 = "你好"; #OK not used
aecba654 »
2008-07-26 [STD] fix heredocs, improve $0 reporting
427 my $t2 = Q /$s2, 世界/;
428 is $t2, '$s2, 世界', "Testing for Q operator. (utf8)";
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
429 }
430
431 # q:b
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
432 #?rakudo skip 'quoting adverbs'
9dac81d1 »
2012-03-02 pugs fudge
433 #?pugs skip 'parsefail'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
434 {
435 my $t = q:b /\n\n\n/;
436 is $t, "\n\n\n", "Testing for q:b operator.";
a9f6653c »
2008-09-11 [t/spec] more Q:b quoting tests
437 is q:b'\n\n', "\n\n", "Testing q:b'\\n'";
438 ok qb"\n\t".chars == 2, 'qb';
439 is Qb{a\nb}, "a\nb", 'Qb';
440 is Q:b{a\nb}, "a\nb", 'Q:b';
441 is Qs:b{\n}, "\n", 'Qs:b';
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
442 }
443
444 # q:x
d279be16 »
2010-03-06 [t/spec] re-fudge quoting.t for rakudo
445 #?rakudo skip 'q:x'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
446 {
83d098b8 »
2009-08-13 refactored q:x for MSWIN32
447 my $result = %*VM.perl ~~ /MSWIN32/ ?? "hello\r\n" !! "hello\n";
448 is q:x/echo hello/, $result, "Testing for q:x operator.";
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
449 }
450 # utf8
d279be16 »
2010-03-06 [t/spec] re-fudge quoting.t for rakudo
451
452 #?rakudo skip 'q:x'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
453 {
454 # 一 means "One" in Chinese.
455 is q:x/echo 一/, "\n", "Testing for q:x operator. (utf8)";
456 }
457
d279be16 »
2010-03-06 [t/spec] re-fudge quoting.t for rakudo
458 #?rakudo skip 'qq:x'
8391eadb »
2009-07-13 [t/spec] more tests for qq:x
459 {
460 my $world = 'world';
461 is qq:x/echo hello $world/, "hello world\n", 'Testing qq:x operator';
462 }
463
d279be16 »
2010-03-06 [t/spec] re-fudge quoting.t for rakudo
464 #?rakudo skip 'q:x assigned to array'
7becae6c »
2012-04-25 niecza autounfudge
465 #?niecza todo ':x'
9dac81d1 »
2012-03-02 pugs fudge
466 #?pugs todo
8391eadb »
2009-07-13 [t/spec] more tests for qq:x
467 {
468 my @two_lines = q:x/echo hello ; echo world/;
469 is @two_lines, ("hello\n", "world\n"), 'testing q:x assigned to array';
470 }
471
d279be16 »
2010-03-06 [t/spec] re-fudge quoting.t for rakudo
472 #?rakudo skip 'q:x assigned to array'
7becae6c »
2012-04-25 niecza autounfudge
473 #?niecza todo ':x'
9dac81d1 »
2012-03-02 pugs fudge
474 #?pugs todo
8391eadb »
2009-07-13 [t/spec] more tests for qq:x
475 {
476 my $hello = 'howdy';
477 my @two_lines = qq:x/echo $hello ; echo world/;
478 is @two_lines, ("$hello\n", "world\n"), 'testing qq:x assigned to array';
479 }
480
481
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
482 # L<S02/Adverbs on quotes/"Interpolate % vars">
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
483 # q:h
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
484 #?rakudo skip 'quoting adverbs'
4bdf17ed »
2011-09-29 Convert niecza faux-todo to real todo.
485 #?niecza todo
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
486 {
487 # Pugs can't parse q:h currently.
488 my %t = (a => "perl", b => "rocks");
489 my $s;
490 $s = q:h /%t<>/;
491 is $s, ~%t, "Testing for q:h operator.";
492 }
493
494 # q:f
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
495 #?rakudo skip 'quoting adverbs'
8cc349a8 »
2011-07-11 some fudging of S02-literals/quoting, S04-declarations/{my, state}; f…
496 #?niecza skip '& escape'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
497 {
db108703 »
2009-06-20 [t/spec] patching difficulties spotted by STD
498 my sub f { "hello" };
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
499 my $t = q:f /&f(), world/;
500 is $t, f() ~ ", world", "Testing for q:f operator.";
501
502 sub f_utf8 { "你好" };
503 $t = q:f /&f_utf8(), 世界/;
504 is $t, f_utf8() ~ ", 世界", "Testing for q:f operator. (utf8)";
505 }
506
507 # q:c
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
508 #?rakudo skip 'quoting adverbs'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
509 {
db108703 »
2009-06-20 [t/spec] patching difficulties spotted by STD
510 my sub f { "hello" };
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
511 my $t = q:c /{f}, world/;
512 is $t, f() ~ ", world", "Testing for q:c operator.";
513 }
514
515 # q:a
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
516 #?rakudo skip 'quoting adverbs'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
517 {
518 my @t = qw/a b c/;
519 my $s = q:a /@t[]/;
520 is $s, ~@t, "Testing for q:a operator.";
521 }
522
523 # q:s
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
524 #?rakudo skip 'quoting adverbs'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
525 {
526 my $s = "someone is laughing";
527 my $t = q:s /$s/;
528 is $t, $s, "Testing for q:s operator.";
529
b87b6396 »
2009-02-10 [t/spec] remove some variable re-declarations found by STD.pm. TimToa…
530 $s = "有人在笑";
531 $t = q:s /$s/;
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
532 is $t, $s, "Testing for q:s operator. (utf8)";
533 }
534
535 # multiple quoting modes
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
536 #?rakudo skip 'quoting adverbs'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
537 {
538 my $s = 'string';
539 my @a = <arr1 arr2>;
8cc349a8 »
2011-07-11 some fudging of S02-literals/quoting, S04-declarations/{my, state}; f…
540 my %h = (foo => 'bar'); #OK not used
aecba654 »
2008-07-26 [STD] fix heredocs, improve $0 reporting
541 is(q:s:a'$s@a[]%h', $s ~ @a ~ '%h', 'multiple modifiers interpolate only what is expected');
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
542 }
543
544 # shorthands:
0c0d81c1 »
2008-09-14 [t/spec] split quoting.t into quoting.t and quoting-unicode.t
545 #?rakudo skip 'quoting adverbs'
8cc349a8 »
2011-07-11 some fudging of S02-literals/quoting, S04-declarations/{my, state}; f…
546 #?niecza skip '& escape, zen slices'
9dac81d1 »
2012-03-02 pugs fudge
547 #?pugs skip 'parsefail'
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
548 {
549 my $alpha = 'foo';
550 my $beta = 'bar';
551 my @delta = <baz qux>;
552 my %gamma = (abc => 123);
553 sub zeta {42};
554
2d6769cb »
2008-07-31 [STD] renamed main package to STD
555 is(qw[a b], <a b>, 'qw');
556 is(qww[$alpha $beta], <foo bar>, 'qww');
557 is(qq[$alpha $beta], 'foo bar', 'qq');
558 is(Qs[$alpha @delta[] %gamma<>], 'foo @delta %gamma', 'Qs');
559 is(Qa[$alpha @delta[] %gamma<>], '$alpha ' ~ @delta ~ ' %gamma', 'Qa');
560 is(Qh[$alpha @delta[] %gamma<>], '$alpha @delta ' ~ %gamma, 'Qh');
561 is(Qf[$alpha &zeta()], '$alpha 42', 'Qf');
562 is(Qb[$alpha\t$beta], '$alpha $beta', 'Qb');
563 is(Qc[{1+1}], 2, 'Qc');
21b2e183 »
2008-06-18 [gsoc_spectest] added more quoting tests. removed kwid from quoting.t…
564 }
aecba654 »
2008-07-26 [STD] fix heredocs, improve $0 reporting
565
75bf7cbc »
2011-08-23 fix all the remaining S02/Literals smartlinks I broke by adding headi…
566 # L<S02/Backslashing/All other quoting forms (including standard single quotes)>
6ce02aa4 »
2008-09-25 [t] merged single_quoted_strings.t into quoting.t
567 {
568 is('test\\', "test\\", "backslashes at end of single quoted string");
9511a2fb »
2008-12-04 [t/spec] add a quoting test by Hinrik++
569 is 'a\\b\''.chars, 4, 'backslash and single quote';
6ce02aa4 »
2008-09-25 [t] merged single_quoted_strings.t into quoting.t
570 }
7f29bc53 »
2009-08-08 [t/spec] Add vim: lines everywhere.
571
8a254280 »
2010-05-08 [t/spec] test for rx/.../ and rx{...} quoting
572 {
573 isa_ok rx/foo/, Regex, 'rx/.../';
574 isa_ok rx{foo}, Regex, 'rx{...}';
fcd44908 »
2010-08-06 [t/spec] tests for rx:i etc. quoting (no semantic checks yet)
575 isa_ok rx:i{foo}, Regex, 'rx:i{...}';
576 isa_ok rx:ignorecase{foo}, Regex, 'rx:i{...}';
577 isa_ok rx:s{foo}, Regex, 'rx:i{...}';
578 isa_ok rx:sigspace{foo}, Regex, 'rx:i{...}';
9dac81d1 »
2012-03-02 pugs fudge
579 #?pugs todo
fcd44908 »
2010-08-06 [t/spec] tests for rx:i etc. quoting (no semantic checks yet)
580 eval_dies_ok 'rx:unknown{foo}', 'rx:unknown dies';
9dac81d1 »
2012-03-02 pugs fudge
581 #?pugs todo
fcd44908 »
2010-08-06 [t/spec] tests for rx:i etc. quoting (no semantic checks yet)
582 eval_dies_ok 'rx:g{foo}', 'g does not make sense on rx//';
8a254280 »
2010-05-08 [t/spec] test for rx/.../ and rx{...} quoting
583 }
584
5091dc05 »
2010-07-09 [t/spec] qx, qqx
585 {
586 my $var = 'world';
f0508b28 »
2010-07-12 [t/spec] make qx/qqx tests more robust
587 is qx/echo world/.chomp, "world", 'qx';
9dac81d1 »
2012-03-02 pugs fudge
588 #?pugs skip 'multi ok'
f0508b28 »
2010-07-12 [t/spec] make qx/qqx tests more robust
589 is qqx/echo $var/.chomp, "world", 'qqx';
c70eae34 »
2011-01-16 add test for RT #78874
590 # RT #78874
591 is qx/echo world/.trans('wd' => 'WD'), "WorlD\n", "qx doesn't return a Parrot string";
5091dc05 »
2010-07-09 [t/spec] qx, qqx
592 }
593
e76dd4c7 »
2010-12-31 s/done_testing/done/ as per recent S24 changes
594 done;
b25d4305 »
2009-10-27 [t/spec] Test for RT 65654
595
7f29bc53 »
2009-08-08 [t/spec] Add vim: lines everywhere.
596 # vim: ft=perl6
Something went wrong with that request. Please try again.