summaryrefslogtreecommitdiff
path: root/t/comp/hints.t
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-04-30 19:03:34 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-04-30 19:03:34 +0000
commit045ac3170cd33a7002e5d26e4859e94ca400926d (patch)
treebf481b2a683c7ccbf658d60a50623597b094923e /t/comp/hints.t
parente8c86ba6ca66f86dc4c8f4de0abf70f53c2484f4 (diff)
downloadperl-045ac3170cd33a7002e5d26e4859e94ca400926d.tar.gz
Fix bug id 20020427.004 on %^H.
Add a regression test for %^H. Change the sort pragma implementation to use a global variable instead of %^H. p4raw-id: //depot/perl@16286
Diffstat (limited to 't/comp/hints.t')
-rw-r--r--t/comp/hints.t36
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";
+}