Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/perl6/roast into problem-…
Browse files Browse the repository at this point in the history
…solving-3
  • Loading branch information
vrurg committed Aug 16, 2019
2 parents b492389 + 381974e commit 26ff0d6
Show file tree
Hide file tree
Showing 110 changed files with 14,917 additions and 11,646 deletions.
8 changes: 3 additions & 5 deletions CONTRIBUTING.md
Expand Up @@ -33,11 +33,9 @@ When all is well, the commits are finalized, the branch is pushed
to the user's fork on Github, and there the PR is initiated.

If a new test file has been created, one additional step has to be
taken: the new test file has to be added to
`github.com/rakudo/rakudo/t/spectest.data` and a PR for project
`github.com/rakudo/rakudo` can be submitted for that. However, it is
easier just to ask for help adding the new test file on IRC channel
`#perl6`.
taken: the new test file has to be added to `spectest.data`.
(This file used to live in the Rakudo repo at `github.com/rakudo/rakudo`
but it is part of `roast` nowadays.)

#### Fudged tests

Expand Down
14 changes: 13 additions & 1 deletion S02-literals/string-interpolation.t
Expand Up @@ -3,7 +3,7 @@ use Test;
use lib $?FILE.IO.parent(2).add("packages/Test-Helpers");
use Test::Util;

plan 40;
plan 42;

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

Expand Down Expand Up @@ -141,4 +141,16 @@ line 4

}

# https://github.com/rakudo/rakudo/issues/3070
{
sub nil-return(--> Nil) {
is "{1}", '1', 'block interpolation ignores Nil return value from enclosing sub';
}
sub int-return(--> 2) {
is "{1}", '1', 'block interpolation ignores integer return value from enclosing sub';
}
nil-return;
int-return;
}

# vim: ft=perl6
19 changes: 19 additions & 0 deletions S02-names/SETTING-6c.t
@@ -0,0 +1,19 @@
# SETTING is a revision-specific namespace.
use v6.c;
use Test;

plan 6;

sub not($x) { $x } #OK
my $setting = 'SETTING';
ok &SETTING::not(False), 'SETTING:: works';
ok &::($setting)::not.(False), '::("SETTING") works';

#?rakudo 4 skip "NYI"
{
ok EVAL('&SETTING::not(False)'), 'SETTING finds eval context';
ok EVAL('&::($setting)::not(False)'), '::("SETTING") finds eval context';
my $f = EVAL('-> $fn { $fn(); }');
ok $f({ &CALLER::SETTING::not(False) }), 'CALLER::SETTING works';
ok $f({ &CALLER::($setting)::not(False) }), 'CALLER::SETTING works (ind)';
}
16 changes: 16 additions & 0 deletions S02-names/SETTING-6e.t
@@ -0,0 +1,16 @@
# SETTING::OUTER::OUTER is a revision-specific namespace.
use v6.e.PREVIEW;
use Test;

plan 6;

sub not($x) { $x } #OK
my $setting = 'SETTING::OUTER::OUTER::OUTER::OUTER';
ok &SETTING::OUTER::OUTER::OUTER::OUTER::not(False), 'SETTING::OUTER::OUTER::OUTER::OUTER:: works';
ok &::($setting)::not.(False), '::("' ~ $setting ~ '::") works';

ok EVAL('&SETTING::OUTER::OUTER::OUTER::OUTER::not(False)'), 'SETTING::OUTER::OUTER::OUTER::OUTER:: finds eval context';
ok EVAL('&::($setting)::not(False)'), '::("' ~ $setting ~ '::") finds eval context';
my $f = EVAL('-> $fn { $fn(); }');
ok $f({ &CALLER::SETTING::OUTER::OUTER::OUTER::OUTER::not(False) }), 'CALLER::SETTING::OUTER::OUTER::OUTER::OUTER:: works';
ok $f({ &CALLER::($setting)::not(False) }), 'CALLER::' ~ $setting ~ ':: works (ind)';
22 changes: 20 additions & 2 deletions S02-names/pseudo.t → S02-names/pseudo-6c.t
@@ -1,8 +1,10 @@
use v6;
use v6.c;

use Test;
use lib $?FILE.IO.parent(2).add("packages/Test-Helpers");
use Test::Util;

plan 155;
plan 159;

# I'm not convinced this is in the right place
# Some parts of this testing (i.e. WHO) seem a bit more S10ish -sorear
Expand Down Expand Up @@ -465,4 +467,20 @@ subtest 'no guts spillage when going too high up scope in pseudopackages' => {
eval-lives-ok '$' ~ $_ x 100 ~ 'True', $_ for @packs;
}

# GH #3058
{
is_run q|use v6.c; our constant &my-not = CORE::<&not>; print "ALIAS: ", my-not(False)|,
{ out => q<ALIAS: True> },
"CORE symbols are available at compile-time";
is_run q|use v6.c; EVAL q«our constant &evaled-not = CORE::<&not>; print "EVAL: ", evaled-not(False)»|,
{ out => q<EVAL: True> },
"CORE symbols are available at compile-time inside EVAL";
is_run q|use v6.c; BEGIN our constant &begin-not = CORE::<&not>; print "BEGIN: ", begin-not(False)|,
{ out => q<BEGIN: True> },
"CORE symbols are available at compile-time in BEGIN";
is_run q|use v6.c; BEGIN EVAL q«our constant &begin-evaled-not = CORE::<&not>; print "BEGIN EVAL: ", begin-evaled-not(False)»|,
{ out => q<BEGIN EVAL: True> },
"CORE symbols are available at compile-time in BEGIN inside EVAL";
}

# vim: ft=perl6

0 comments on commit 26ff0d6

Please sign in to comment.