Skip to content

Commit

Permalink
add tests for isa override and method creation with eval RT #60946 an…
Browse files Browse the repository at this point in the history
…d RT #61354

git-svn-id: http://svn.pugscode.org/pugs@26499 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
ron committed Apr 27, 2009
1 parent 7d5f283 commit e70591f
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion S12-class/basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 29;
plan 32;

=begin pod
Expand Down Expand Up @@ -96,3 +96,34 @@ class One::Two { }
ok(One::Two.new, 'created One::Two after One::Two::Three');
eval_dies_ok 'class One::Two { }', 'cannot redeclare an existing class';
eval_lives_ok q[BEGIN {class Level1::Level2::Level3 {};}; class Level1::Level2 {};], 'RT#62898';

#?rakudo todo 'RT #60946'
{
class Mock::PGE::Match {
method isa($x) { return $x === PGE::Match || self.HOW.isa(self, $x); }
}

sub get_pir_isa_pge_match {
Q:PIR {
get_hll_global $P0, ["Mock";"PGE"], "Match"
$P1 = $P0."new"()
$I0 = isa $P1, ["PGE";"Match"] # add "Mock" to fudge success ...
.return ($I0)
}
}
is get_pir_isa_pge_match(), Mock::PGE::Match.new.isa(PGE::Match),
'pir isa cannot see override' ;
}

#?rakudo 2 todo 'RT 61354'
{
eval_lives_ok 'class A61354 { eval q/method x { "OH HAI" }/ }',
'define method with eval in class lives';
# switch comment lines below to fudge success
# is eval('class A61354_1 { method x { "OH HAI" } }; A61354_1.x'),
is eval('class A61354_1 { eval q/method x { "OH HAI" }/ }; A61354_1.x'),
'OH HAI',
'define method with eval in class';
}

0 comments on commit e70591f

Please sign in to comment.