- Timestamp:
- 11/04/08 17:56:11 (2 months ago)
- Files:
-
- 1 modified
-
t/spec/S12-class/basic.t (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
t/spec/S12-class/basic.t
r20418 r22869 21 21 # override the behaviour without playing with the metamodel via traits 22 22 ok($foo.isa(Foo), '.isa(Foo)'); 23 #?rakudo 1 skip 'parse error'24 23 ok($foo.isa(::Foo), '.isa(::Foo)'); 25 24 ok($foo.isa("Foo"), '.isa("Foo")'); 26 25 ok(!$foo.isa("Bar"), '!.isa("Bar")'); 27 26 28 my $foo_clone = $foo.clone(); 29 ok($foo_clone ~~ Foo, '... smartmatch our $foo_clone to the Foo class'); 27 #?rakudo skip 'clone not yet implemetned' 28 { 29 my $foo_clone = $foo.clone(); 30 ok($foo_clone ~~ Foo, '... smartmatch our $foo_clone to the Foo class'); 31 } 30 32 31 33 class Foo::Bar {} … … 35 37 36 38 ok($foo_bar.isa(Foo::Bar), '.isa(Foo::Bar)'); 37 #?rakudo 1 skip 'parse error'38 39 ok(!$foo_bar.isa(::Foo), '!Foo::Bar.new.isa(::Foo)'); 39 40 … … 50 51 ok($bar.isa(Foo), "new Bar .isa(Foo)"); 51 52 52 my $bar_clone = $bar.clone(); 53 ok($bar_clone ~~ Bar, '... smartmatch our $bar_clone to the Bar class'); 54 ok($bar_clone.isa(Bar), "... .isa(Bar)"); 55 ok($bar_clone ~~ Foo, '... smartmatch our $bar_clone to the Foo class'); 56 ok($bar_clone.isa(Foo), "... .isa(Foo)"); 57 53 #?rakudo skip 'clone not yet implemetned' 54 #?DOES 4 55 { 56 my $bar_clone = $bar.clone(); 57 ok($bar_clone ~~ Bar, '... smartmatch our $bar_clone to the Bar class'); 58 ok($bar_clone.isa(Bar), "... .isa(Bar)"); 59 ok($bar_clone ~~ Foo, '... smartmatch our $bar_clone to the Foo class'); 60 ok($bar_clone.isa(Foo), "... .isa(Foo)"); 61 } 58 62 59 63 # Same, but with the "is Foo" declaration inlined 60 #?rakudo 5skip 'not parsing is inside class yet'64 #?rakudo skip 'not parsing is inside class yet' 61 65 #?DOES 3 62 class Baz { is Foo } 63 ok(Baz ~~ Foo, '... smartmatch our Baz to the Foo class'); 64 my $baz = Baz.new(); 65 ok($baz ~~ Baz, '... smartmatch our $baz to the Baz class'); 66 ok($baz.isa(Baz), "... .isa(Baz)"); 67 66 { 67 class Baz { is Foo } 68 ok(Baz ~~ Foo, '... smartmatch our Baz to the Foo class'); 69 my $baz = Baz.new(); 70 ok($baz ~~ Baz, '... smartmatch our $baz to the Baz class'); 71 ok($baz.isa(Baz), "... .isa(Baz)"); 72 }
