Commit | Line | Data |
32645610 |
1 | #!./perl |
2 | |
3 | BEGIN { |
4 | chdir 't'; |
5 | @INC = ('../lib', 'lib'); |
6 | } |
7 | |
8 | use strict; |
9 | use warnings; |
f52edb18 |
10 | use Test::More tests => 9; |
32645610 |
11 | |
12 | use mypragma (); # don't enable this pragma yet |
13 | |
14 | BEGIN { |
15 | is($^H{mypragma}, undef, "Shouldn't be in %^H yet"); |
16 | } |
17 | |
18 | is(mypragma::in_effect(), undef, "pragma not in effect yet"); |
19 | { |
f52edb18 |
20 | is(mypragma::in_effect(), undef, "pragma not in effect yet"); |
21 | eval qq{is(mypragma::in_effect(), undef, "pragma not in effect yet"); 1} |
22 | or die $@; |
23 | |
32645610 |
24 | use mypragma; |
25 | is(mypragma::in_effect(), 1, "pragma is in effect within this block"); |
f52edb18 |
26 | eval qq{is(mypragma::in_effect(), 1, |
27 | "pragma is in effect within this eval"); 1} or die $@; |
32645610 |
28 | } |
29 | is(mypragma::in_effect(), undef, "pragma no longer in effect"); |
f52edb18 |
30 | eval qq{is(mypragma::in_effect(), undef, "pragma not in effect"); 1} or die $@; |
32645610 |
31 | |
32 | |
33 | BEGIN { |
34 | is($^H{mypragma}, undef, "Should no longer be in %^H"); |
35 | } |