Skip to content

Commit

Permalink
Call method .raku instead of .perl in tests
Browse files Browse the repository at this point in the history
Yes, this is a big commit.  Some may still be missed  :-(
  • Loading branch information
lizmat committed Jan 3, 2020
1 parent 6d23891 commit aa4994a
Show file tree
Hide file tree
Showing 222 changed files with 868 additions and 868 deletions.
4 changes: 2 additions & 2 deletions MISC/bug-coverage-stress.t
Expand Up @@ -11,7 +11,7 @@ plan 12;

# RT #132042
doesn't-hang
my $fh = ~ make-temp-file.perl ~ .open: :w;
my $fh = ~ make-temp-file.raku ~ .open: :w;
await ^20 .map: -> $t {
start {
for ^500 -> $i {
Expand Down Expand Up @@ -64,7 +64,7 @@ with make-temp-dir() -> $dir {
is_run q:to//,
await do for ^200 {
start {
for \qq[$dir.perl()].dir -> $path {
for \qq[$dir.raku()].dir -> $path {
die "FAILED!" if $path.absolute ne $path.Str
}
}
Expand Down
6 changes: 3 additions & 3 deletions S01-perl-5-integration/eval_lex.t
Expand Up @@ -20,15 +20,15 @@ subtest 'EVAL/EVALFILE evals Buf like perl would execute source file' => {

# The $result Buf was obtained by running:
# perl -e 'no warnings; print qq|♥\x{26666}|; { use utf8; print qq|♥\x{26666}| }' |
# ./perl6 -e '$*IN.encoding(Nil); $*IN.slurp.perl.say'
# ./perl6 -e '$*IN.encoding(Nil); $*IN.slurp.raku.say'
my $result = Buf[uint8].new(195,162,194,153,194,165,240,166,153,166,226,153,165,240,166,153,166);

my $code = no warnings; print qq|♥\x{26666}|; { use utf8; print qq|♥\x{26666}| };

subtest 'EVAL' => {
plan 3;
given run :out, :err, $*EXECUTABLE, '-e',
'use MONKEY-SEE-NO-EVAL; EVAL :lang<Perl5>, \qq[$code.perl()]'
'use MONKEY-SEE-NO-EVAL; EVAL :lang<Perl5>, \qq[$code.raku()]'
{
is-deeply .out.slurp-rest(:bin), $result, 'STDOUT has right data';
is-deeply .err.slurp, '', 'STDERR is empty';
Expand All @@ -42,7 +42,7 @@ subtest 'EVAL/EVALFILE evals Buf like perl would execute source file' => {
$path.spurt: $code;
given run :out, :err, $*EXECUTABLE, '-e',
'use MONKEY-SEE-NO-EVAL; EVALFILE :lang<Perl5>,'
~ $path.absolute.perl
~ $path.absolute.raku
{
is-deeply .out.slurp-rest(:bin), $result, 'STDOUT has right data';
is-deeply .err.slurp, '', 'STDERR is empty';
Expand Down
4 changes: 2 additions & 2 deletions S02-lexical-conventions/unspace.t
Expand Up @@ -310,8 +310,8 @@ is &infix:<+>( 5\ , 5), 10, 'unspace between first and second argument';
is &infix:<+>( 5 \ , 5), 10, 'unspace between first and second argument with leading space';

# RT #117465
is "foo".\ \ perl, "foo".perl, 'two unspace in a row after . for method call';
is "foo"\ \ .perl, "foo".perl, 'two unspace in a row before . for method call';
is "foo".\ \ perl, "foo".raku, 'two unspace in a row after . for method call';
is "foo"\ \ .raku, "foo".raku, 'two unspace in a row before . for method call';

# \# okay within a regex
ok '#' ~~ /\#/, 'Unspace restriction in regex does not apply to \#';
Expand Down
38 changes: 19 additions & 19 deletions S02-literals/allomorphic.t
Expand Up @@ -122,7 +122,7 @@ lives-ok {val("foo")}, "val() exists";

for @wordlist -> ($val, $wrong-type) {
isa-ok $val, Str, "'$val' from qw[] is a Str";
nok $val.isa($wrong-type), "'$val' from qw[] is not a $wrong-type.perl()";
nok $val.isa($wrong-type), "'$val' from qw[] is not a $wrong-type.raku()";
}
}

Expand All @@ -131,7 +131,7 @@ lives-ok {val("foo")}, "val() exists";

for @wordlist -> ($val, $wrong-type) {
isa-ok $val, Str, "'$val' from qqww[] is a Str";
nok $val.isa($wrong-type), "'$val' from qqww[] is not a $wrong-type.perl()";
nok $val.isa($wrong-type), "'$val' from qqww[] is not a $wrong-type.raku()";
}
}

Expand All @@ -142,8 +142,8 @@ lives-ok {val("foo")}, "val() exists";

for (@wordlist Z @purenum Z @allotypes) -> ($val, $ntype, $atype) {
isa-ok $val, Str, "'$val' from qw:v[] is a Str";
isa-ok $val, $ntype, "'$val' from qw:v[] is a $ntype.perl()";
isa-ok $val, $atype, "'$val' from qw:v[] is a $atype.perl()";
isa-ok $val, $ntype, "'$val' from qw:v[] is a $ntype.raku()";
isa-ok $val, $atype, "'$val' from qw:v[] is a $atype.raku()";
}
}

Expand All @@ -154,8 +154,8 @@ lives-ok {val("foo")}, "val() exists";

for (@wordlist Z @purenum Z @allotypes) -> ($val, $ntype, $atype) {
isa-ok $val, Str, "'$val' from qw:v[] is a Str";
isa-ok $val, $ntype, "'$val' from qw:v[] is a $ntype.perl()";
isa-ok $val, $atype, "'$val' from qw:v[] is a $atype.perl()";
isa-ok $val, $ntype, "'$val' from qw:v[] is a $ntype.raku()";
isa-ok $val, $atype, "'$val' from qw:v[] is a $atype.raku()";
}
}

Expand Down Expand Up @@ -216,8 +216,8 @@ subtest 'eqv with allomorphs' => {
plan +@tests;
for @tests -> ($a, $b) {
$a.^name eq $b.^name
?? is-deeply $a eqv $b, True, "$a.perl() eqv $b.perl()"
!! is-deeply $a eqv $b, False, "$a.perl() eqv $b.perl()"
?? is-deeply $a eqv $b, True, "$a.raku() eqv $b.raku()"
!! is-deeply $a eqv $b, False, "$a.raku() eqv $b.raku()"
}
}

Expand All @@ -231,14 +231,14 @@ subtest 'cmp with allomorphs' => {
my @more = @less.map: { .value => .key };
plan @same + @less + @more;

is-deeply $_ cmp $_, Same, "{.perl} cmp {.perl}" for @same;
is-deeply $_ cmp $_, Same, "{.raku} cmp {.raku}" for @same;

for @less -> (:key($a), :value($b)) {
is-deeply $a cmp $b, Less, "$a.perl() cmp $b.perl()"
is-deeply $a cmp $b, Less, "$a.raku() cmp $b.raku()"
}

for @more -> (:key($a), :value($b)) {
is-deeply $a cmp $b, More, "$a.perl() cmp $b.perl()"
is-deeply $a cmp $b, More, "$a.raku() cmp $b.raku()"
}
}

Expand Down Expand Up @@ -327,12 +327,12 @@ subtest '.ACCEPTS' => {

for @true -> (:key($allo), :value($thing)) {
is-deeply $allo.ACCEPTS($thing), True,
"{$allo.perl}.ACCEPTS({$thing.perl})"
"{$allo.raku}.ACCEPTS({$thing.raku})"
}

for @false -> (:key($allo), :value($thing)) {
is-deeply $allo.ACCEPTS($thing), False,
"{$allo.perl}.ACCEPTS({$thing.perl})"
"{$allo.raku}.ACCEPTS({$thing.raku})"
}
}

Expand Down Expand Up @@ -386,14 +386,14 @@ subtest '.Numeric on :U allomorphs and Numeric type objects' => {
plan 3*@types + @allos + 6;

for flat CustomNumeric, @types, @allos -> \T {
warns-like { T.Numeric }, *.contains('uninitialized'&'numeric'), T.perl;
warns-like { T.Numeric }, *.contains('uninitialized'&'numeric'), T.raku;
}

quietly {
is-deeply CustomNumeric.Numeric, 42, 'Numeric:U.Numeric calls self.new';
for @types {
isa-ok .Numeric, $_, "{.perl}.Numeric gives a {.perl} value";
cmp-ok .Numeric, '==', 0, "{.perl}.Numeric gives a zero";
isa-ok .Numeric, $_, "{.raku}.Numeric gives a {.raku} value";
cmp-ok .Numeric, '==', 0, "{.raku}.Numeric gives a zero";
}

is-deeply IntStr .Numeric, 0, 'IntStr .Numeric gives a 0';
Expand All @@ -411,7 +411,7 @@ subtest '.Real on :U allomorphs and Numeric type objects' => {
plan @types + @allos + 9;

for flat @types, @allos -> \T {
warns-like { T.Real }, *.contains('uninitialized'&'numeric'), T.perl;
warns-like { T.Real }, *.contains('uninitialized'&'numeric'), T.raku;
}

quietly {
Expand Down Expand Up @@ -445,8 +445,8 @@ subtest '.Bool on allomorphs' => {
my @false := <0>, <0e0>, <-0e0>, <0.0>, <0/0>,
<0+0i>, <0e0+0e0i>, <-0e0+0e0i>, <-0e0-0e0i>, <0e0-0e0i>;
plan @true + @false;
is-deeply .so, True, .perl for @true;
is-deeply .so, False, .perl for @false;
is-deeply .so, True, .raku for @true;
is-deeply .so, False, .raku for @false;
}

# GH#2010
Expand Down
2 changes: 1 addition & 1 deletion S02-literals/pairs.t
Expand Up @@ -181,7 +181,7 @@ throws-like ":7\x[308]a", X::Syntax::Malformed,

# RT #129008
is-perl-idempotent(((Int) => 42));
is-perl-idempotent(((Pair) => 42), ".perl of (Pair) => 42 is idempotent"); # .gist WAT?
is-perl-idempotent(((Pair) => 42), ".raku of (Pair) => 42 is idempotent"); # .gist WAT?
is-perl-idempotent(((Num) => 42));
is-perl-idempotent(((Str) => 42));
is-perl-idempotent((:a(Bool)));
Expand Down
8 changes: 4 additions & 4 deletions S02-literals/quoting.t
Expand Up @@ -306,18 +306,18 @@ Note that non-ASCII tests are kept in quoting-unicode.t
{
# <<:Pair>>
my @q = <<:p(1)>>;
is(@q[0].perl, :p(1).item.perl, "pair inside <<>>-quotes - simple");
is(@q[0].raku, :p(1).item.raku, "pair inside <<>>-quotes - simple");

@q = <<:p(1) junk>>;
is(@q[0].perl, :p(1).item.perl, "pair inside <<>>-quotes - with some junk");
is(@q[0].raku, :p(1).item.raku, "pair inside <<>>-quotes - with some junk");
is(@q[1], 'junk', "pair inside <<>>-quotes - junk preserved");

@q = <<:def>>;
is(@q[0].perl, (:def).item.perl, ":pair in <<>>-quotes with no explicit value");
is(@q[0].raku, (:def).item.raku, ":pair in <<>>-quotes with no explicit value");

@q = "(EVAL failed)";
try { EVAL '@q = <<:p<moose>>>;' };
is(@q[0].perl, (p => "moose").item.perl, ":pair<anglequoted>");
is(@q[0].raku, (p => "moose").item.raku, ":pair<anglequoted>");
};

{ # weird char escape sequences
Expand Down
4 changes: 2 additions & 2 deletions S02-magicals/DISTRO.t
Expand Up @@ -25,7 +25,7 @@ get a list of osnames that have actually passed tests.
ok $?DISTRO.release, "Release info is '{$?DISTRO.release}'";
ok $?DISTRO.path-sep, "Path separator is '{$?DISTRO.path-sep}'";

ok $?DISTRO.perl ~~ m/\w/, 'We can do a $?DISTRO.perl';
ok $?DISTRO.raku ~~ m/\w/, 'We can do a $?DISTRO.raku';
ok $?DISTRO.gist ~~ m/\w/, 'We can do a $?DISTRO.gist';
ok $?DISTRO.Str ~~ m/\w/, 'We can do a $?DISTRO.Str';

Expand All @@ -47,7 +47,7 @@ ok $*DISTRO.desc, "Description is '{$*DISTRO.desc}'";
ok $*DISTRO.release, "Release info is '{$*DISTRO.release}'";
ok $*DISTRO.path-sep, "Path separator is '{$*DISTRO.path-sep}'";

ok $*DISTRO.perl ~~ m/\w/, 'We can do a $*DISTRO.perl';
ok $*DISTRO.raku ~~ m/\w/, 'We can do a $*DISTRO.raku';
ok $*DISTRO.gist ~~ m/\w/, 'We can do a $*DISTRO.gist';
ok $*DISTRO.Str ~~ m/\w/, 'We can do a $*DISTRO.Str';

Expand Down
4 changes: 2 additions & 2 deletions S02-magicals/KERNEL.t
Expand Up @@ -18,7 +18,7 @@ plan 42;
ok $?KERNEL.arch, "Architecture info is '{$?KERNEL.arch}'";
ok $?KERNEL.bits, "Number of bits is '{$?KERNEL.bits}'";

ok $?KERNEL.perl ~~ m/\w/, 'We can do a $?KERNEL.perl';
ok $?KERNEL.raku ~~ m/\w/, 'We can do a $?KERNEL.raku';
ok $?KERNEL.gist ~~ m/\w/, 'We can do a $?KERNEL.gist';
ok $?KERNEL.Str ~~ m/\w/, 'We can do a $?KERNEL.Str';

Expand All @@ -44,7 +44,7 @@ ok $*KERNEL.arch, "Architecture info is '{$*KERNEL.arch}'";
ok $*KERNEL.bits, "Number of bits is '{$*KERNEL.bits}'";
ok $*KERNEL.hostname, "Hostname is '{$*KERNEL.hostname}'";

ok $*KERNEL.perl ~~ m/\w/, 'We can do a $*KERNEL.perl';
ok $*KERNEL.raku ~~ m/\w/, 'We can do a $*KERNEL.raku';
ok $*KERNEL.gist ~~ m/\w/, 'We can do a $*KERNEL.gist';
ok $*KERNEL.Str ~~ m/\w/, 'We can do a $*KERNEL.Str';

Expand Down
8 changes: 4 additions & 4 deletions S02-magicals/PERL.t
Expand Up @@ -14,7 +14,7 @@ plan 46;
ok $?PERL.desc, "Description is '{$?PERL.desc}'";
ok $?PERL.compiler, "Has compiler info";

ok $?PERL.perl ~~ m/\w/, 'We can do a $?PERL.perl';
ok $?PERL.raku ~~ m/\w/, 'We can do a $?PERL.raku';
ok $?PERL.gist ~~ m/\w/, 'We can do a $?PERL.gist';
ok $?PERL.Str ~~ m/\w/, 'We can do a $?PERL.Str';

Expand All @@ -31,7 +31,7 @@ plan 46;
ok $C.release, "Release is '{$C.release}'";
ok $C.codename, "Codename is '{$C.codename}'";

ok $C.perl, 'We can do a $?PERL.compiler.perl';
ok $C.raku, 'We can do a $?PERL.compiler.raku';
ok $C.gist, 'We can do a $?PERL.compiler.gist';

isa-ok $C.version, Version;
Expand All @@ -47,7 +47,7 @@ ok $*PERL.signature, "Signature is '{$*PERL.signature}'";
ok $*PERL.desc, "Description is '{$*PERL.desc}'";
ok $*PERL.compiler, "Has compiler info";

ok $*PERL.perl ~~ m/\w/, 'We can do a $*PERL.perl';
ok $*PERL.raku ~~ m/\w/, 'We can do a $*PERL.raku';
ok $*PERL.gist ~~ m/\w/, 'We can do a $*PERL.gist';
ok $*PERL.Str ~~ m/\w/, 'We can do a $*PERL.Str';

Expand All @@ -69,7 +69,7 @@ ok $C.release, "Release is '{$C.release}'";
#?rakudo todo 'no Perl.compiler.codename yet RT #124624'
ok $C.codename, "Codename is '{$C.codename}'";

ok $C.perl, 'We can do a $?PERL.compiler.perl';
ok $C.raku, 'We can do a $?PERL.compiler.raku';
ok $C.gist, 'We can do a $?PERL.compiler.gist';

isa-ok $C.version, Version;
Expand Down
4 changes: 2 additions & 2 deletions S02-magicals/VM.t
Expand Up @@ -27,7 +27,7 @@ plan 32;
ok $?VM.precomp-target, "Extension is '{$?VM.precomp-target}'";
ok $?VM.prefix, "Prefix is '{$?VM.prefix}'";

ok $?VM.perl ~~ m/\w/, 'We can do a $?VM.perl';
ok $?VM.raku ~~ m/\w/, 'We can do a $?VM.raku';
ok $?VM.gist ~~ m/\w/, 'We can do a $?VM.gist';
ok $?VM.Str ~~ m/\w/, 'We can do a $?VM.Str ';

Expand All @@ -50,7 +50,7 @@ ok $*VM.precomp-ext, "Extension is '{$*VM.precomp-ext}'";
ok $*VM.precomp-target, "Extension is '{$*VM.precomp-target}'";
ok $*VM.prefix, "Prefix is '{$*VM.prefix}'";

ok $*VM.perl ~~ m/\w/, 'We can do a $*VM.perl';
ok $*VM.raku ~~ m/\w/, 'We can do a $*VM.raku';
ok $*VM.gist ~~ m/\w/, 'We can do a $*VM.gist';
ok $*VM.Str ~~ m/\w/, 'We can do a $*VM.Str';

Expand Down
4 changes: 2 additions & 2 deletions S02-magicals/dollar_bang.t
Expand Up @@ -46,7 +46,7 @@ try {
{
$! = Nil;
try { die('goodbye'); }
ok defined( $!.perl ), '$! has working Raku object methods after try';
ok defined( $!.raku ), '$! has working Raku object methods after try';
ok ($!.WHAT ~~ Exception), '$! is Exception object after try';
# - S04-statements/try.t tests $! being set after try.
# - S29-context/die.t tests $! being set after die.
Expand All @@ -56,7 +56,7 @@ try {
ok ($!), '$! as boolean works (true)';

try { EVAL q[ die('farewell'); ] };
ok defined($!.perl), '$! has working Raku object methods after eval';
ok defined($!.raku), '$! has working Raku object methods after eval';
ok ($!.WHAT ~~ Exception), '$! is Exception object after eval';
# Although S29-context/die.t tests $! being set after die, it's not
# from within an eval, so we test the eval/die combination here.
Expand Down
2 changes: 1 addition & 1 deletion S02-magicals/env.t
Expand Up @@ -96,7 +96,7 @@ throws-like { EVAL "%ENV" },
{
%*ENV<ABC> = 'def';
ok %*ENV.gist ~~ /ABC/, '%*ENV.gist generates something with ABC in it';
ok %*ENV.perl ~~ /ABC/, '%*ENV.perl generates something with ABC in it';
ok %*ENV.raku ~~ /ABC/, '%*ENV.raku generates something with ABC in it';
}

# RT #117951
Expand Down

0 comments on commit aa4994a

Please sign in to comment.