Skip to content

Commit

Permalink
Merge branch 'master' into placeholder_tickets
Browse files Browse the repository at this point in the history
One of the modified files was renamed on master.
  • Loading branch information
usev6 committed Aug 1, 2019
2 parents 931bf87 + 397425b commit eda9f35
Show file tree
Hide file tree
Showing 76 changed files with 14,355 additions and 11,567 deletions.
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 eda9f35

Please sign in to comment.