This is an automatically generated mail to inform you that tests are now available in t/spec/S12-class/anonymous.t
commit 003f3f51c26dd19f6f7d4969f992d2727f9b034e Author: kyle <k...@c213334d-75ef-0310-aa23-eaa082d1ae64> Date: Tue Aug 4 19:37:22 2009 +0000 [t/spec] Test for RT #64888 git-svn-id: http://svn.pugscode.org/p...@27872 c213334d-75ef-0310-aa23-eaa082d1ae64 diff --git a/t/spec/S12-class/anonymous.t b/t/spec/S12-class/anonymous.t index 5f87f25..9f3c1d1 100644 --- a/t/spec/S12-class/anonymous.t +++ b/t/spec/S12-class/anonymous.t @@ -3,7 +3,7 @@ use v6; use Test; # L<S12/Classes/"Perl 6 supports multiple inheritance, anonymous classes"> -plan 12; +plan 16; # Create and instantiate empty class; check .WHAT works and stringifies to # empty string. @@ -46,3 +46,24 @@ is($t3.x, 42, 'anonymous classes can have attributes'); ok($x ~~ TestParent, 'anonymous class isa TestParent'); is($x.foo, 42, 'inherited method from TestParent'); } + +# RT #64888 +{ + sub rt64888 { + ( + class { + method Str() { 'RT #64888' } + method Num() { 64888 } + } + ).new + } + my $i1; + my $i2; + + lives_ok { $i1 = rt64888() }, 'can get anonymous class instance once'; + #?rakudo todo 'RT #64888' + lives_ok { $i2 = rt64888() }, 'can get anonymous class instance twice'; + + is ~$i1, 'RT #64888', 'anonymous class stringified works'; + is +$i1, 64888, 'anonymous class numified works'; +}