Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
rakudo.jvm fudge
  • Loading branch information
coke committed Sep 8, 2013
1 parent ecc7bf8 commit 148f92c
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 6 deletions.
1 change: 1 addition & 0 deletions S02-magicals/config.t
Expand Up @@ -26,6 +26,7 @@ my $osnames = lc any <darwin linux freebsd MSWin32 mingw msys cygwin browser sol
#?rakudo skip 'unimpl $?OS'
ok $?OS.lc eq $osnames, "we know of the OS we were compiled in";

#?rakudo.jvm skip "'mac os x' - should probably be 'darwin'"
ok $*OS.lc eq $osnames, "we know of the OS we are running under";

# like $*OS, this is tested in perlver.t but that test is not included
Expand Down
1 change: 1 addition & 0 deletions S02-magicals/env.t
Expand Up @@ -88,6 +88,7 @@ eval_dies_ok("%ENV", '%ENV not visible by default');
}

#?niecza skip "Cannot call is_run; none of these signatures match"
#?rakudo.jvm skip "Cannot call is_run; none of these signatures match"
{
%*ENV<abc> = 'def';
is_run 'print %*ENV<abc>',
Expand Down
6 changes: 6 additions & 0 deletions S02-names/caller.t
Expand Up @@ -4,6 +4,7 @@ use Test;

plan 15;

#?rakudo.jvm skip "Nominal type check failed for parameter 'null'"
{
my $a is dynamic = 9;
my $sub = sub { $CALLER::a };
Expand All @@ -14,6 +15,7 @@ plan 15;
}
} #1

#?rakudo.jvm skip "Nominal type check failed for parameter 'null'"
{
my $a is dynamic = 9;
my $sub2 = sub { $CALLER::a };
Expand Down Expand Up @@ -49,6 +51,7 @@ plan 15;
} #2

# L<S02/Names/The CALLER package refers to the lexical scope>
#?rakudo.jvm skip "Nominal type check failed for parameter 'null'"
{
# $_ is always implicitly declared "is dynamic".
my sub foo () { $CALLER::_ }
Expand All @@ -61,6 +64,7 @@ plan 15;
is bar(), 42, '$_ is implicitly declared "is dynamic" (1)';
} #1

#?rakudo.jvm skip "Nominal type check failed for parameter 'null'"
{
# $_ is always implicitly declared "is dynamic".
# (And, BTW, $_ is lexical.)
Expand Down Expand Up @@ -111,13 +115,15 @@ plan 15;
nok (try modify()) eq 'success', '"::=" vars are ro when accessed with $CALLER::';
} #1

#?rakudo.jvm skip "Nominal type check failed for parameter 'null'"
{
my sub modify { $CALLER::_++ }
$_ = 42;
modify();
is $_, 43, '$_ is implicitly rw (2)';
} #1

#?rakudo.jvm skip "Nominal type check failed for parameter 'null'"
{
my sub modify { $CALLER::foo++ }
my $foo is dynamic = 42;
Expand Down
8 changes: 6 additions & 2 deletions S02-names/is_default.t
Expand Up @@ -63,17 +63,19 @@ plan 114;
#?rakudo.jvm skip "oh no, .VAR does not work on JVM"
is $b.VAR.default, 42, 'is the default set correctly for Int $b';

#?rakudo.jvm emit #
my Int $c is default(Nil);
#?rakudo.jvm skip "oh no, .VAR does not work on JVM"
#?rakudo.jvm 5 skip 'Type check failed in assignment to "$c"; expected "Int" but got "Any"'
ok $c.VAR.default === Nil, 'is the default set correctly for Int $c';
lives_ok { $c++ }, 'should be able to increment typed variable';
is $c, 1, "typed variable should be incremented";
lives_ok { $c = Nil }, "should be able to assign Nil to typed variable";
ok $c === Nil, 'is the default value correctly reset for Int $c';

#?rakudo.jvm emit #
my Int $d is default(Nil) = 353;
#?rakudo.jvm 2 skip 'Type check failed in assignment to "$d"; expected "Int" but got "Any"'
is $d, 353, "typed variable should be initialized";
#?rakudo.jvm skip "oh no, .VAR does not work on JVM"
ok $d.VAR.default === Nil, 'is the default set correctly for Int $d';
} #19

Expand Down Expand Up @@ -140,6 +142,7 @@ plan 114;
ok @c.VAR.default === Nil, 'is the default set correctly for Int @c';
lives_ok { @c[0]++ }, 'should be able to increment typed variable';
is @c[0], 1, "typed variable should be incremented";
#?rakudo.jvm 2 todo "nigh"
lives_ok { @c[0] = Nil }, "able to assign Nil to typed variable";
ok @c[0] === Nil, 'is the default value correctly reset for Int @c[0]';

Expand Down Expand Up @@ -212,6 +215,7 @@ plan 114;
ok %c.VAR.default === Nil, 'is the default set correctly for Int %c';
lives_ok { %c<o>++ }, 'should be able to increment typed variable';
is %c<o>, 1, "typed variable should be incremented";
#?rakudo.jvm 2 todo "nigh"
lives_ok { %c<o> = Nil }, "able to assign Nil to typed variable";
ok %c<o> === Nil, 'is the default value correctly reset for Int %c<o>';

Expand Down
1 change: 1 addition & 0 deletions S02-names/pseudo.t
Expand Up @@ -311,6 +311,7 @@ plan 142;
}

# CALLER - assumes MY:: has taken care of most access testing
#?rakudo.jvm skip "Nominal type check failed for parameter 'null'"
{
sub f1($f) { my $x is dynamic = 90; $f() } #OK
sub f2($f) { my $x is dynamic = 91; f1($f) } #OK
Expand Down
1 change: 1 addition & 0 deletions S02-names/symbolic-deref.t
Expand Up @@ -98,6 +98,7 @@ my $outer = 'outside';
$result = $sub();
};

#?rakudo.jvm todo "nigh"
is $result, 42, "symbolic dereferentation works with ::CALLER, too";
}

Expand Down
1 change: 1 addition & 0 deletions S02-types/lists.t
Expand Up @@ -149,6 +149,7 @@ plan 28;
try { eval '<1 2 3>.rt62836' };
#?pugs 2 todo
ok "$!" ~~ /rt62836/, 'error message contains name of sub';
#?rakudo.jvm todo "nigh"
ok "$!" ~~ /Parcel/, 'error message contains name of class';

#?pugs emit #
Expand Down
1 change: 1 addition & 0 deletions S02-types/nil.t
Expand Up @@ -100,6 +100,7 @@ ok !Nil.new.defined, 'Nil.new is not defined';
ok $! === Nil, '$! is by default Nil';
ok $_ === Nil, '$_ is by default Nil';

#?rakudo.jvm 3 skip "Nominal type check failed for parameter 'null'"
ok $/.VAR.default === Nil, '$/ has Nil as default';
ok $!.VAR.default === Nil, '$! has Nil as default';
ok $_.VAR.default === Nil, '$_ has Nil as default';
Expand Down
1 change: 1 addition & 0 deletions S02-types/type.t
Expand Up @@ -53,6 +53,7 @@ my Str $bar;
lives_ok({my Int $beta = Nil}, 'object Int type can be undefined');
eval_lives_ok('my num $alpha = 1e0', 'Has native type num');
#?pugs 2 todo
#?rakudo.jvm todo "nigh"
eval_lives_ok('my num $alpha = Nil', 'native num type can be undefined');
lives_ok({my Num $beta = Nil}, 'object Num type can be undefined');
}
Expand Down
2 changes: 2 additions & 0 deletions S04-phasers/enter-leave.t
Expand Up @@ -159,6 +159,7 @@ plan 21;
}
$str ~= ')';
}
#?rakudo.jvm todo "nigh"
is $str, '(x)', 'die in LEAVE caught by try';
}

Expand Down Expand Up @@ -189,6 +190,7 @@ plan 21;

#?niecza todo '@!'
#?pugs todo
#?rakudo.jvm skip 'unwind'
{
my $str;
try {
Expand Down
1 change: 1 addition & 0 deletions S04-statements/gather.t
Expand Up @@ -203,6 +203,7 @@ plan 28;
}

# tests for the S04-control.pod document
#?rakudo.jvm skip "unwind"
{
my @list = 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 6, 6;
my @uniq = gather for @list {
Expand Down
1 change: 1 addition & 0 deletions S04-statements/loop.t
Expand Up @@ -101,6 +101,7 @@ eval_dies_ok 'loop { say "# RT63760"; last } while 1',
'"loop {} while" is a syntax error (RT 63760)';

# RT #112654
#?rakudo.jvm skip 'unwind'
{
my @a = gather loop { take 1; take 2; last };
is @a.join, '12', 'gather, take and loop work together';
Expand Down
1 change: 1 addition & 0 deletions S04-statements/try.t
Expand Up @@ -112,6 +112,7 @@ plan 26;

# RT #68728
#?pugs todo
#?rakudo.jvm skip "Method 'substr' not found"
{
my $str = '';
try {
Expand Down
1 change: 1 addition & 0 deletions S06-advanced/wrap.t
Expand Up @@ -204,6 +204,7 @@ dies_ok { {nextsame}() }, '{nextsame}() dies properly';
}

# RT #69312
#?rakudo.jvm skip "control operator crossed continuation barrier"
{
my @t = gather {
sub triangle { take '=' x 3; }
Expand Down
1 change: 1 addition & 0 deletions S06-macros/quasi-blocks.t
Expand Up @@ -86,6 +86,7 @@ plan 12;
is $result, "I'm cupid!", "lexical lookup from quasi to macro works";
}

#?rakudo.jvm skip "Method 'succ' not found"
{
my $counter = 0;

Expand Down
1 change: 1 addition & 0 deletions S16-io/getc.t
Expand Up @@ -18,6 +18,7 @@ my $tmpfile = "temp-test" ~ nonce();
close $fh or die "Couldn't close \"$tmpfile\": $!\n";
}

#?rakudo.jvm skip "Method 'read' not found"
{
my $fh = open $tmpfile or die "Couldn't open \"$tmpfile\" for reading: $!\n";
my @chars;
Expand Down
3 changes: 2 additions & 1 deletion S32-io/io-path-win.t
Expand Up @@ -50,10 +50,11 @@ ok IO::Path::Win32.new("A:b").is-relative, '"A:b" is relative';

is $relpath.absolute, IO::Spec::Win32.canonpath("$*CWD\\foo\\bar"), "absolute path from \$*CWD";
is $relpath.absolute("\\usr"), "\\usr\\foo\\bar", "absolute path specified";
#?rakudo.jvm 4 skip "Method 'match' not found"
is IO::Path::Win32.new("\\usr\\bin").relative("/usr"), "bin", "relative path specified";
is $relpath.absolute.relative, "foo\\bar", "relative inverts absolute";
is $relpath.absolute("/foo").relative("\\foo"), "foo\\bar","absolute inverts relative";
#?rakudo 1 todo 'resolve NYI, needs nqp::readlink'
#?rakudo.parrot 1 todo 'resolve NYI, needs nqp::readlink'
is $abspath.relative.absolute.resolve, "\\foo\\bar", "absolute inverts relative with resolve";

is IO::Path::Win32.new("foo/bar").parent, "foo", "parent of 'foo/bar' is 'foo'";
Expand Down
8 changes: 6 additions & 2 deletions S32-io/io-spec-win.t
Expand Up @@ -261,8 +261,12 @@ my @abs2rel =
#('C:\\one\\two\\t\\asd1\\', 't\\asd\\').item, '..\\asd1',
#('\\one\\two', 'A:\\foo').item, 'C:\\one\\two';

for @abs2rel -> $in, $out {
is $win32.abs2rel(|$in), $out, "abs2rel: {$in.perl} -> '$out'"
#?rakudo.jvm skip "Method 'match' not found"
#?DOES 19
{
for @abs2rel -> $in, $out {
is $win32.abs2rel(|$in), $out, "abs2rel: {$in.perl} -> '$out'"
}
}

my @rel2abs =
Expand Down
4 changes: 3 additions & 1 deletion S32-scalar/perl.t
Expand Up @@ -10,6 +10,7 @@ plan 6;
'can we serialize a simple scalar';
my $ra = eval($a.perl);
is_deeply $ra, $a, 'can we roundtrip simple scalar';
#?rakudo.jvm skip "Nominal type check failed for parameter 'null'"
ok $ra.VAR.of =:= Mu, 'make sure any value can be stored';
} #3

Expand All @@ -23,7 +24,8 @@ plan 6;
'can we serialize a scalar with constrained values';
my $ra = eval($a.perl);
is_deeply $ra, $a, 'can we roundtrip scalar constrained values';
#?rakudo todo "cannot roundtrip constrained scalars yet"
#?rakudo.jvm skip "Nominal type check failed for parameter 'null'"
#?rakudo.parrot todo "cannot roundtrip constrained scalars yet"
ok $ra.VAR.of =:= Int, 'make sure roundtripped values are Int';
} #3

Expand Down

0 comments on commit 148f92c

Please sign in to comment.