$| = 1;
}
-print "1..91\n";
+print "1..98\n";
$a = {};
bless $a, "Bob";
$a = new Alice;
test $a->isa("Alice");
+test $a->isa("main::Alice"); # check that alternate class names work
+
+test(("main::Alice"->new)->isa("Alice"));
test $a->isa("Bob");
+test $a->isa("main::Bob");
test $a->isa("Female");
main::test can( "Pickup", "can" ) == \&UNIVERSAL::can;
main::test VERSION "UNIVERSAL" ;
}
+
+{
+ # test isa() and can() on magic variables
+ "Human" =~ /(.*)/;
+ test $1->isa("Human");
+ test $1->can("eat");
+ package HumanTie;
+ sub TIESCALAR { bless {} }
+ sub FETCH { "Human" }
+ tie my($x), "HumanTie";
+ ::test $x->isa("Human");
+ ::test $x->can("eat");
+}