Permalink
Browse files

add tests for isa override and method creation with eval RT #60946 an…

…d RT #61354

git-svn-id: http://svn.pugscode.org/pugs@26499 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
ron
ron committed Apr 27, 2009
1 parent 7d5f283 commit e70591f276e8cadae423575abcd9f9a77eaa73f1
Showing with 32 additions and 1 deletion.
  1. +32 −1 S12-class/basic.t
View
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 29;
+plan 32;
=begin pod
@@ -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.