summaryrefslogtreecommitdiff
path: root/dist/B-Deparse/t/deparse.t
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-12-06 23:29:21 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-12-07 06:15:37 -0800
commitc306e834a2e7e21d20699178dd251b8b8171bc14 (patch)
tree4b5c3fcdc3231e479b03194426c281c8d4805e6a /dist/B-Deparse/t/deparse.t
parent70397346423dee021539e9ebb34b4cf1e097ca50 (diff)
downloadperl-c306e834a2e7e21d20699178dd251b8b8171bc14.tar.gz
Deparse: detect hh changes properly
The hack to check whether the hint hash has changed doesn’t work. One actually has to iterate through the hash. Since declare_hinthash does that already, just call it. The change to declare_hinthash to return an empty list instead of '' is one of those theoretical speed-ups. It results in one less state- ment and two fewer method calls in its caller.
Diffstat (limited to 'dist/B-Deparse/t/deparse.t')
-rw-r--r--dist/B-Deparse/t/deparse.t8
1 files changed, 8 insertions, 0 deletions
diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t
index d47498cf59..a4284ef33f 100644
--- a/dist/B-Deparse/t/deparse.t
+++ b/dist/B-Deparse/t/deparse.t
@@ -809,3 +809,11 @@ BEGIN { $^H{'foo'} = undef; }
}
BEGIN { $^H{q[']} = '('; }
print $_;
+####
+# hint hash changes that serialise the same way with sort %hh
+BEGIN { $^H{'a'} = 'b'; }
+{
+ BEGIN { $^H{'b'} = 'a'; delete $^H{'a'}; }
+ print $_;
+}
+print $_;