Permalink
Browse files

Add a failing test for localising %^H

  • Loading branch information...
1 parent 80ae952 commit e3893d1a54a4819abb5b4fb7182fea786db02765 @rafl committed Feb 16, 2012
Showing with 50 additions and 0 deletions.
  1. +50 −0 t/localise.t
View
@@ -0,0 +1,50 @@
+use strict;
+use warnings;
+
+use Test::More 0.89;
+
+use B::Hooks::EndOfScope;
+
+{
+ my $fired;
+
+ {
+ BEGIN { on_scope_end { $fired++ } }
+
+ BEGIN { ok(!$fired) }
+
+ BEGIN { local %^H }
+
+ BEGIN { ok(!$fired) }
+ }
+
+ BEGIN { ok($fired) }
+}
+
+{
+ my $fired;
+
+ {
+ BEGIN { on_scope_end { $fired++ } }
+ BEGIN { ok(!$fired) }
+
+ BEGIN {
+ local %^H;
+
+ my $fired2;
+ {
+ BEGIN { on_scope_end { $fired2++ } }
+ BEGIN { ok(!$fired2) }
+ BEGIN { local %^H }
+ BEGIN { ok(!$fired2) }
+ }
+ BEGIN { ok($fired2) }
+ }
+
+ BEGIN { ok(!$fired) }
+ }
+
+ BEGIN { ok($fired) }
+}
+
+done_testing;

0 comments on commit e3893d1

Please sign in to comment.