diff options
Diffstat (limited to 't/comp/hints.t')
-rw-r--r-- | t/comp/hints.t | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/t/comp/hints.t b/t/comp/hints.t new file mode 100644 index 0000000000..5911b77688 --- /dev/null +++ b/t/comp/hints.t @@ -0,0 +1,36 @@ +#!./perl -w + +BEGIN { print "1..7\n"; } +BEGIN { + print "not " if exists $^H{foo}; + print "ok 1 - \$^H{foo} doesn't exist initially\n"; +} +{ + # simulate a pragma -- don't forget HINT_LOCALIZE_HH + BEGIN { $^H |= 0x00020000; $^H{foo} = "a"; } + BEGIN { + print "not " if $^H{foo} ne "a"; + print "ok 2 - \$^H{foo} is now 'a'\n"; + } + { + BEGIN { $^H |= 0x00020000; $^H{foo} = "b"; } + BEGIN { + print "not " if $^H{foo} ne "b"; + print "ok 3 - \$^H{foo} is now 'b'\n"; + } + } + BEGIN { + print "not " if $^H{foo} ne "a"; + print "ok 4 - \$H^{foo} restored to 'a'\n"; + } + CHECK { + print "not " if exists $^H{foo}; + print "ok 6 - \$^H{foo} doesn't exist when compilation complete\n"; + } + print "not " if exists $^H{foo}; + print "ok 7 - \$^H{foo} doesn't exist at runtime\n"; +} +BEGIN { + print "not " if exists $^H{foo}; + print "ok 5 - \$^H{foo} doesn't exist while finishing compilation\n"; +} |