Skip to content

Commit c61ef73

Browse files
committed
Merge branch 'master' of git://github.com/perl6/roast
2 parents 0af5065 + d1b9ba1 commit c61ef73

File tree

44 files changed

+225
-126
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+225
-126
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.rakudo
22
*.niecza
33
*.pugs
4+
S32-io/server-ready-flag

S02-lexical-conventions/bom.t

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
use v6;
2+
use Test;
3+
4+
plan 1;
5+
6+
ok 1, 'can parse a file starting with a byte-order mark';

S02-lexical-conventions/comments.t

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ use Test;
1818
Parens works also
1919
) 1, 'multiline embedded comment with #`()';
2020

21+
# RT #115762
22+
eval_lives_ok "#`( foo )", "comment as first and only statement";
23+
2124
eval_lives_ok "2 * 3\n #`<<<\n comment>>>", "multiline comment with <<<";
2225

2326
my $var = #`{ foo bar } 32;
@@ -76,7 +79,7 @@ use Test;
7679
>>> 1, '#`<<<...>>>';
7780
}
7881

79-
#?rakudo skip 'nom regression'
82+
#?rakudo todo 'nom regression'
8083
{
8184
eval_lives_ok( q{{
8285
my $var = \#`((( comment ))) 12;
@@ -103,7 +106,6 @@ use Test;
103106

104107
# I am not sure if this is speced somewhere:
105108
# comments can be nested
106-
#?rakudo skip 'nested brackets'
107109
#?niecza skip 'Possible runaway string'
108110
{
109111
is 3, #`(
@@ -126,6 +128,7 @@ use Test;
126128
# comment() before seeing that I meant #`{ comment within this string.
127129

128130
#?pugs todo 'bug'
131+
#?rakudo skip 'NYI'
129132
eval_lives_ok " #`<<\n comment\n # >>\n >> 3",
130133
'single line comment cannot correctly nested within multiline';
131134
}

S02-literals/listquote.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ eval_dies_ok '({:a<1>, :b(2)} <a b c>)', '{...} <...> parsefail';
2929
ok( ?((1 | 3) < 3), '(...) < 3 no parsefail');
3030

3131
#?pugs todo 'parsing bug'
32-
#?rakudo todo 'parsing'
3332
eval_dies_ok '(1 | 3)<3', '()<3 parsefail';
3433

3534
# WRONG: should be parsed as print() < 3

S02-literals/misc-interpolation.t

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ is('$world @list[] %hash{} &func()', '$world @list[] %hash{} &func()', 'single q
6363
is("Hello $world!", "Hello World!", "! is not a part of var names");
6464
sub list_count (*@args) { +@args }
6565
is(list_count("@list[]"), 1, 'quoted interpolation gets string context');
66-
#?niecza todo 'apparently curly brace delimiters DO interfere with closure interpolation'
67-
is(qq{a{chr 98}c}, 'abc', "curly brace delimiters don't interfere with closure interpolation");
66+
is(qq{a{chr 98}c}, 'a{chr 98}c', "curly brace delimiters interfere with closure interpolation");
6867

6968
# Quoting constructs
7069
# The next test will always succeed, but if there's a bug it probably
@@ -73,7 +72,6 @@ is(qq{a{chr 98}c}, 'abc', "curly brace delimiters don't interfere with closure i
7372
is(Q"abc\\d\\'\/", Q"abc\\d\\'\/", "raw quotation works");
7473
is(q"abc\\d\"\'\/", Q|abc\d"\'\/|, "single quotation works"); #"
7574
is(qq"abc\\d\"\'\/", Q|abc\d"'/|, "double quotation works"); #"
76-
#?rakudo 3 skip 'qa qb and array/hash interpolation'
7775
#?pugs skip 'parsefail'
7876
is(qa"$world @list[] %hash{}", Q"$world 1 2 %hash{}", "only interpolate array");
7977
is(qb"$world \\\"\n\t", "\$world \\\"\n\t", "only interpolate backslash");

S02-literals/quoting.t

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ Note that non-ASCII tests are kept in quoting-unicode.t
9595
};
9696

9797
# L<S02/C<Q> forms/:q>
98-
#?rakudo skip 'Q:q adverbs'
9998
#?pugs skip 'parsefail'
10099
{ # adverb variation
101100
my @q = ();
@@ -134,7 +133,6 @@ Note that non-ASCII tests are kept in quoting-unicode.t
134133
};
135134

136135
# L<S02/C<Q> forms/:qq>
137-
#?rakudo skip 'Q:qq adverbs'
138136
#?pugs skip 'parsefail'
139137
{ # adverb variation
140138
my @q = ();
@@ -144,7 +142,7 @@ Note that non-ASCII tests are kept in quoting-unicode.t
144142
};
145143
146144
# L<S02/Interpolating into a single-quoted string/using the \qq>
147-
#?rakudo skip 'q[..] with variations'
145+
148146
{ # \qq[] constructs interpolate in q[]
149147
my ( @q1, @q2, @q3, @q4 ) = ();
150148
@q1 = q[$foo \qq[$bar]];
@@ -197,7 +195,7 @@ Note that non-ASCII tests are kept in quoting-unicode.t
197195
is(@q[1], '$bar', '...');
198196
};
199197
200-
#?rakudo skip 'q:w'
198+
201199
{ # adverb variation
202200
my @q = ();
203201
@q = (q:w/$foo $bar/);
@@ -206,7 +204,6 @@ Note that non-ASCII tests are kept in quoting-unicode.t
206204
is(@q[1], '$bar', "...");
207205
};
208206
209-
#?rakudo skip 'q:w'
210207
{ # whitespace sep aration does not break quote constructor
211208
# L<S02/Whitespace before adverbs/Whitespace is allowed between the "q" and its adverb: q :w /.../.>
212209
my @q = ();
@@ -216,8 +213,6 @@ Note that non-ASCII tests are kept in quoting-unicode.t
216213
is(@q[1], '$bar', "...");
217214
};
218215
219-
220-
#?rakudo skip 'quoting with adverbs'
221216
{ # qq:w,Interpolating quote constructor with words adverb
222217
# L<S02/Adverbs on quotes/"Split result on words (no quote protection)">
223218
my (@q1, @q2) = ();
@@ -231,7 +226,6 @@ Note that non-ASCII tests are kept in quoting-unicode.t
231226
is(~@q2, 'FOO "gorch BAR"', "long form output is the same as the short");
232227
};
233228
234-
#?rakudo skip 'quoting with adverbs'
235229
#?niecza todo
236230
{ # qq:ww, interpolating L<S02/Literals/double angles do interpolate>
237231
# L<S02/Forcing item context/"implicit split" "shell-like fashion">
@@ -260,7 +254,7 @@ Note that non-ASCII tests are kept in quoting-unicode.t
260254
is <<a $rt65654 z>>.elems, 4, 'interpolate variable with spaces (Texas)';
261255
}
262256
263-
#?rakudo skip '«...»'
257+
#?rakudo todo '«...»'
264258
#?niecza todo
265259
{
266260
#L<S02/Forcing item context/"relationship" "single quotes" "double angles">
@@ -288,7 +282,6 @@ Note that non-ASCII tests are kept in quoting-unicode.t
288282
};
289283
290284
# L<S02/Heredocs/Heredocs are no longer written>
291-
#?rakudo skip 'quoting with adverbs'
292285
{ # qq:to
293286
my @q = ();
294287
@@ -300,11 +293,10 @@ $foo
300293
FOO
301294
302295
is(+@q, 1, "q:to// is singular");
303-
is(@q[0], "blah\nBAR\nblah\nFOO\n", "here doc interpolated");
296+
is(@q[0].subst(/\r/, '', :g), "blah\nBAR\nblah\nFOO\n", "here doc interpolated");
304297
};
305298
306299
# L<S02/Optional whitespace/Heredocs allow optional whitespace>
307-
#?rakudo skip 'quoting with adverbs'
308300
{ # q:to indented
309301
my @q = ();
310302
@@ -314,18 +306,17 @@ FOO
314306
FOO
315307
316308
is(+@q, 1, "q:to// is singular, also when indented");
317-
is(@q[0], "blah blah\n\$foo\n", "indentation stripped");
309+
is(@q[0].subst(/\r/, '', :g), "blah blah\n\$foo\n", "indentation stripped");
318310
};
319311
320-
#?rakudo skip 'heredocs'
321312
{ # q:heredoc backslash bug
322313
my @q = q:heredoc/FOO/
323314
yoink\n
324315
splort\\n
325316
FOO
326317
;
327318
is(+@q, 1, "q:heredoc// is singular");
328-
is(@q[0], "yoink\\n\nsplort\\n\n", "backslashes");
319+
is(@q[0].subst(/\r/, '', :g), "yoink\\n\nsplort\\n\n", "backslashes");
329320
}
330321
331322
#?pugs skip 'parsefail'
@@ -364,7 +355,6 @@ FOO
364355
is(@q[0].perl, (p => "moose").perl, ":pair<anglequoted>");
365356
};
366357
367-
#?rakudo skip '\c97 etc'
368358
{ # weird char escape sequences
369359
is("\c97", "a", '\c97 is "a"');
370360
is("\c102oo", "foo", '\c102 is "f", works next to other letters');
@@ -376,7 +366,8 @@ FOO
376366
377367
is("\x41", "A", 'hex interpolation - \x41 is "A"');
378368
is("\o101", "A", 'octal interpolation - \o101 is also "A"' );
379-
369+
370+
#?rakudo 3 skip '\c@ etc'
380371
is("\c@", "\0", 'Unicode code point "@" converts correctly to "\0"');
381372
is("\cA", chr(1), 'Unicode "A" is #1!');
382373
is("\cZ", chr(26), 'Unicode "Z" is chr 26 (or \c26)');
@@ -391,20 +382,19 @@ is( q<< <<woot>> >>, ' <<woot>> ', 'nested <<texas>> quotes (RT #66888)' );
391382
392383
# L<S02/Adverbs on quotes/"for user-defined quotes">
393384
# q:to
394-
#?rakudo skip 'quoting with adverbs'
395385
{
396386
my $t;
397387
$t = q:to /STREAM/;
398388
Hello, World
399389
STREAM
400390
401-
is $t, "Hello, World\n", "Testing for q:to operator.";
391+
is $t.subst(/\r/, '', :g), "Hello, World\n", "Testing for q:to operator.";
402392
403393
$t = q:to /结束/;
404394
Hello, World
405395
结束
406396
407-
is $t, "Hello, World\n", "Testing for q:to operator. (utf8)";
397+
is $t.subst(/\r/, '', :g), "Hello, World\n", "Testing for q:to operator. (utf8)";
408398
}
409399
410400
# Q
@@ -420,7 +410,6 @@ Hello, World
420410
}
421411
422412
# q:b
423-
#?rakudo skip 'quoting adverbs'
424413
#?pugs skip 'parsefail'
425414
{
426415
my $t = q:b /\n\n\n/;
@@ -433,34 +422,31 @@ Hello, World
433422
}
434423
435424
# q:x
436-
#?rakudo skip 'q:x'
437425
{
438-
my $result = %*VM.perl ~~ /MSWIN32/ ?? "hello\r\n" !! "hello\n";
426+
my $result = $*OS ~~ /:i win32/ ?? "hello\r\n" !! "hello\n";
439427
is q:x/echo hello/, $result, "Testing for q:x operator.";
440428
}
441429
# utf8
442430
443-
#?rakudo skip 'q:x'
444431
{
445432
# 一 means "One" in Chinese.
446433
is q:x/echo 一/, "\n", "Testing for q:x operator. (utf8)";
447434
}
448435
449-
#?rakudo skip 'qq:x'
450436
{
451437
my $world = 'world';
452-
is qq:x/echo hello $world/, "hello world\n", 'Testing qq:x operator';
438+
ok qq:x/echo hello $world/ ~~ /^'hello world'\n$/, 'Testing qq:x operator';
453439
}
454440
455-
#?rakudo skip 'q:x assigned to array'
441+
#?rakudo todo 'q:x assigned to array'
456442
#?niecza todo ':x'
457443
#?pugs todo
458444
{
459445
my @two_lines = q:x/echo hello ; echo world/;
460446
is @two_lines, ("hello\n", "world\n"), 'testing q:x assigned to array';
461447
}
462448
463-
#?rakudo skip 'q:x assigned to array'
449+
#?rakudo todo 'q:x assigned to array'
464450
#?niecza todo ':x'
465451
#?pugs todo
466452
{
@@ -472,7 +458,6 @@ Hello, World
472458
473459
# L<S02/Adverbs on quotes/"Interpolate % vars">
474460
# q:h
475-
#?rakudo skip 'quoting adverbs'
476461
#?niecza todo
477462
{
478463
# Pugs can't parse q:h currently.
@@ -483,7 +468,6 @@ Hello, World
483468
}
484469
485470
# q:f
486-
#?rakudo skip 'quoting adverbs'
487471
#?niecza skip '& escape'
488472
{
489473
my sub f { "hello" };
@@ -496,23 +480,20 @@ Hello, World
496480
}
497481
498482
# q:c
499-
#?rakudo skip 'quoting adverbs'
500483
{
501484
my sub f { "hello" };
502485
my $t = q:c /{f}, world/;
503486
is $t, f() ~ ", world", "Testing for q:c operator.";
504487
}
505488
506489
# q:a
507-
#?rakudo skip 'quoting adverbs'
508490
{
509491
my @t = qw/a b c/;
510492
my $s = q:a /@t[]/;
511493
is $s, ~@t, "Testing for q:a operator.";
512494
}
513495
514496
# q:s
515-
#?rakudo skip 'quoting adverbs'
516497
{
517498
my $s = "someone is laughing";
518499
my $t = q:s /$s/;
@@ -524,7 +505,6 @@ Hello, World
524505
}
525506
526507
# multiple quoting modes
527-
#?rakudo skip 'quoting adverbs'
528508
{
529509
my $s = 'string';
530510
my @a = <arr1 arr2>;

S02-literals/string-interpolation.t

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use v6;
22
use Test;
3-
plan 13;
3+
plan 14;
44

55
# L<S02/Closures/"A bare closure also interpolates in double-quotish context.">
66

@@ -56,4 +56,9 @@ line 4
5656
is "this should $w\</a>", 'this should work</a>', 'backslash after scalar';
5757
}
5858

59+
# RT #115508
60+
{
61+
is ord("\a"), 7, "alarm"
62+
}
63+
5964
# vim: ft=perl6

S02-names/pseudo.t

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22

33
use Test;
44

5-
plan 140;
5+
plan 142;
66

77
# I'm not convinced this is in the right place
88
# Some parts of this testing (i.e. WHO) seem a bit more S10ish -sorear
@@ -240,6 +240,15 @@ plan 140;
240240
}
241241
}
242242

243+
#RT #89706
244+
#?niecza skip "readonly"
245+
{
246+
$PROCESS::PROGRAM_NAME = "otter";
247+
is $*PROGRAM_NAME, "otter", 'existing $* assignable via PROCESS';
248+
$PROCESS::SOME_OTHER_VAR = "else";
249+
is $*SOME_OTHER_VAR, "else", 'new $* assignable via PROCESS';
250+
}
251+
243252
# COMPILING - not testable without BEGIN
244253

245254
# DYNAMIC

S02-types/array.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ my @array2 = ("test", 1, Mu);
253253
"through a variable is run-time error";
254254
#?pugs todo
255255
dies_ok { @arr[$minus_one] = 42 }, "assigning to [-1] of a normal array is fatal";
256-
#?rakudo skip "binding not yet fatal"
256+
#?rakudo todo "binding not yet fatal"
257257
#?pugs todo
258258
dies_ok { @arr[$minus_one] := 42 }, "binding [-1] of a normal array is fatal";
259259
}

S02-types/bag.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ sub showkv($x) {
4343
is +$b, 8, '+$bag gives sum of values';
4444
}
4545

46-
#?rakudo skip ':exists and :delete NYI'
4746
{
4847
my $s = bag <a a b foo>;
4948
is $s<a>:exists, True, ':exists with existing element';

0 commit comments

Comments
 (0)