Lines Matching refs:isa
11 use feature 'isa';
18 sub isa { length($_[1]) == 9; }
26 ok($baseobj isa BaseClass, '$baseobj isa BaseClass');
27 ok(not($baseobj isa Another::Class), '$baseobj is not Another::Class');
30 ok($baseobj isa "BaseClass", '$baseobj isa BaseClass');
31 ok(not($baseobj isa "DerivedClass"), '$baseobj is not DerivedClass');
33 ok($derivedobj isa "DerivedClass", '$derivedobj isa DerivedClass');
34 ok($derivedobj isa "BaseClass", '$derivedobj isa BaseClass');
38 ok($derivedobj isa $classname, '$derivedobj isa DerivedClass via SV');
40 # Invoked on instance which overrides ->isa
41 ok($customobj isa "Something", '$customobj isa Something');
42 ok(not($customobj isa "SomethingElse"), '$customobj isa SomethingElse');
44 ok(not(undef isa "BaseClass"), 'undef is not BaseClass');
45 ok(not([] isa "BaseClass"), 'ARRAYref is not BaseClass');
47 # Test that isa object method still works.
49 ok($baseobj->isa('BaseClass'), '$baseobj isa BaseClass using object method');
50 ok(not($baseobj->isa('DerivedClass')), '$baseobj is not BaseClass using object method');
51 ok($derivedobj->isa('BaseClass'), '$derivedobj isa BaseClass using object method');