Non-VMS-fixed and Win32-skipped version of
[p5sagit/p5-mst-13.2.git] / t / op / override.t
index d24bdee..590fcaa 100755 (executable)
@@ -6,7 +6,7 @@ BEGIN {
     push @INC, '../lib';
 }
 
-print "1..10\n";
+print "1..11\n";
 
 #
 # This file tries to test builtin override using CORE::GLOBAL
@@ -47,7 +47,7 @@ print "not " unless $r eq "5.6";
 print "ok 6\n";
 
 require v5.6;
-print "not " unless $r == 5.006 && $r eq "\x05\x06";
+print "not " unless abs($r - 5.006) < 0.001 && $r eq "\x05\x06";
 print "ok 7\n";
 
 eval "use Foo";
@@ -61,3 +61,12 @@ print "ok 9\n";
 eval "use 5.6";
 print "not " unless $r eq "5.6";
 print "ok 10\n";
+
+# localizing *CORE::GLOBAL::foo should revert to finding CORE::foo
+{
+    local(*CORE::GLOBAL::require);
+    $r = '';
+    eval "require NoNeXiSt;";
+    print "not " if $r or $@ !~ /^Can't locate NoNeXiSt/i;
+    print "ok 11\n";
+}