t/op/my_stash.t should use test.pl instead of Test.pm
[p5sagit/p5-mst-13.2.git] / t / op / universal.t
old mode 100755 (executable)
new mode 100644 (file)
index 9817d3f..a1ff975
@@ -10,7 +10,7 @@ BEGIN {
     require "./test.pl";
 }
 
-plan tests => 111;
+plan tests => 117;
 
 $a = {};
 bless $a, "Bob";
@@ -228,3 +228,28 @@ package main;
 eval { UNIVERSAL::DOES([], "foo") };
 like( $@, qr/Can't call method "DOES" on unblessed reference/,
     'DOES call error message says DOES, not isa' );
+
+# Tests for can seem to be split between here and method.t
+# Add the verbatim perl code mentioned in the comments of
+# http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-05/msg01710.html
+# but never actually tested.
+is(UNIVERSAL->can("NoSuchPackage::foo"), undef);
+
+@splatt::ISA = 'zlopp';
+ok (splatt->isa('zlopp'));
+ok (!splatt->isa('plop'));
+
+# This should reset the ->isa lookup cache
+@splatt::ISA = 'plop';
+# And here is the new truth.
+ok (!splatt->isa('zlopp'));
+ok (splatt->isa('plop'));
+
+use warnings "deprecated";
+{
+    my $m;
+    local $SIG{__WARN__} = sub { $m = $_[0] };
+    eval "use UNIVERSAL";
+    like($m, qr/^UNIVERSAL->import is deprecated/,
+       "deprecation warning for UNIVERSAL->import");
+}