Skip to content
Permalink
Browse files

Added tests for correct CORE.setting loaded

See if correct CORE.<rev>.setting is loaded with use v6.<rev>
  • Loading branch information...
vrurg committed May 23, 2019
1 parent 0522259 commit 3f25ba9212d23b70058bb938ccc3c3b587eb2806
@@ -1,5 +1,5 @@
use nqp;

my sub CORE-SETTING-REV {'d'}
sub CORE-SETTING-REV {'d'}

# vim: ft=perl6 expandtab sw=4
@@ -1,5 +1,5 @@
use nqp;

my sub CORE-SETTING-REV {'e'}
sub CORE-SETTING-REV {'e'}

# vim: ft=perl6 expandtab sw=4
@@ -66,6 +66,6 @@ PROCESS::<$SCHEDULER> = JavaScriptScheduler.new();
BEGIN {nqp::p6setassociativetype(Associative);}
#?endif

my sub CORE-SETTING-REV {'c'}
sub CORE-SETTING-REV {'c'}

# vim: ft=perl6 expandtab sw=4
@@ -0,0 +1,24 @@
use lib <t/packages>;
use Test;
use Test::Helpers;

plan 2;

subtest "CORE.setting Revision", {
plan 3;
is-run q[use v6.c; print CORE-SETTING-REV], "CORE.setting", :out<c>;
is-run q[use v6.d; print CORE-SETTING-REV], "CORE.d.setting", :out<d>;
is-run q[use v6.e.PREVIEW; print CORE-SETTING-REV], "CORE.e.setting", :out<e>;
};

subtest "Modifiers", {
plan 4;
# This test must be edited to match currently planned revision.
my $planned_rev = 'e';
is-run qq[use v6.$planned_rev; print CORE-SETTING-REV], "6.$planned_rev without PREVIEW dies", :exitcode(1), :err(rx:s/Perl v6'.'$planned_rev requires modifier PREVIEW/);
is-run q[use v6.d.TEST; print CORE-SETTING-REV], "v6.d.TEST loads CORE.d.setting", :out<d>;
is-run q[use v6.d.TESTDEPR; print CORE-SETTING-REV], "Deprecated modifier generates a warning", :out<d>, :err(rx:s/TESTDEPR modifier is deprecated for Perl 6'.'d/);
is-run q[use v6.d.NOMOD; print CORE-SETTING-REV], "Deprecated modifier generates a warning", :exitcode(1), :err(rx:s/No compiler available for Perl v6'.'d'.'NOMOD/);
}
done-testing;
@@ -18,6 +18,7 @@ my %allowed = (
Q{&CLONE-LIST-DECONTAINERIZED},
Q{&CMP-SLOW},
Q{&COMP_EXCEPTION},
Q{&CORE-SETTING-REV},
Q{&CREATE_RATIONAL_FROM_INTS},
Q{&DEPRECATED},
Q{&DIVIDE_NUMBERS},
@@ -22,6 +22,7 @@ my %allowed = (
Q{::?PACKAGE},
Q{EXPORT},
Q{GLOBALish},
Q{&CORE-SETTING-REV},
).map: { $_ => 1 };

my @unknown;

0 comments on commit 3f25ba9

Please sign in to comment.
You can’t perform that action at this time.