Skip to content

Commit

Permalink
Fix(?) S06/lvalue-subroutines, fudge Proxy tests for niecza
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Feb 4, 2012
1 parent 5815031 commit 428e7b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion S02-types/declare.t
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@ plan 79;
isa_ok($mapti, Matcher);
}

#?niecza skip 'Proxy not implemented'
{
my Proxy $krati;
isa_ok($krati, Proxy);
Expand Down
8 changes: 4 additions & 4 deletions S06-routine-modifiers/lvalue-subroutines.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 15;
plan 14;

=begin description
Expand Down Expand Up @@ -32,6 +32,7 @@ Testing lvalue-returning subroutines
my $notlvalue = sub () { $var };

#?pugs 2 todo 'bug'
#?niecza 2 todo 'rw checking'
dies_ok { $notlvalue() = 23 },
"assigning to non-rw subrefs should die";
is $var, 42,
Expand All @@ -56,14 +57,13 @@ Testing lvalue-returning subroutines
# S6 says that lvalue subroutines are marked out by 'is rw'
sub notlvalue { $var; } # without rw

#?niecza 2 todo 'rw checking'
dies_ok { notlvalue() = 5 },
"assigning to non-rw subs should die";
is $var, 42,
"assigning to non-rw subs shouldn't modify the original variable";
}

my $val2; # XXX prevent parsefail below, not sure what test wants

sub check ($passwd) { $passwd eq "fish"; };

sub checklastval ($passwd) is rw {
Expand All @@ -84,7 +84,7 @@ dies_ok {checklastval("octopus") = 10 }, 'checklastval STORE can die';
# Above test may well die for the wrong reason, if the Proxy stuff didn't
# parse OK, it will complain that it couldn't find the desired subroutine
#?rakudo 3 skip 'maximum recursion depth exceeded'
is((try { checklastval("fish") = 12; $val2 }), 12, 'proxy lvalue subroutine STORE works');
is((try { checklastval("fish") = 12 }), 12, 'proxy lvalue subroutine STORE works');
my $resultval = checklastval("fish");
is($resultval, 12, 'proxy lvalue subroutine FETCH works');

Expand Down

0 comments on commit 428e7b0

Please sign in to comment.