This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Test require override with Deparse [perl #62500]
authorFather Chrysostomos <sprout@cpan.org>
Sat, 21 May 2011 17:18:26 +0000 (10:18 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 21 May 2011 17:18:51 +0000 (10:18 -0700)
dist/B-Deparse/t/deparse.t

index 802c31f..5ea240a 100644 (file)
@@ -183,6 +183,19 @@ EOCODE
   is $deparsed, $code, 'our $funny_Unicode_chars';
 }
 
   is $deparsed, $code, 'our $funny_Unicode_chars';
 }
 
+# [perl #62500]
+$a =
+  `$^X $path "-MO=Deparse" -e "BEGIN{*CORE::GLOBAL::require=sub{1}}" 2>&1`;
+$a =~ s/-e syntax OK\n//g;
+is($a, <<'EOCODF', "CORE::GLOBAL::require override causing panick");
+sub BEGIN {
+    *CORE::GLOBAL::require = sub {
+        1;
+    }
+    ;
+}
+EOCODF
+
 done_testing();
 
 __DATA__
 done_testing();
 
 __DATA__