summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-09-02 12:53:49 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-09-02 12:53:49 +0000
commitdd85fe9f7f1f07fbb5e40b599391665cc850bd43 (patch)
treeba9313b547b15da9e2e0418902dee812fc9f99b0 /ext
parentcc6ed77d04bf16cb06af8602b4d69f01bf68bd79 (diff)
downloadperl-dd85fe9f7f1f07fbb5e40b599391665cc850bd43.tar.gz
Regression test for the fix in change #25308,
based on code by Troy Loveday p4raw-link: @25308 on //depot/perl: 27688d77084069fcb656e12fab5d3ee0ba810e6c p4raw-id: //depot/perl@25347
Diffstat (limited to 'ext')
-rw-r--r--ext/Data/Dumper/t/bugs.t35
1 files changed, 35 insertions, 0 deletions
diff --git a/ext/Data/Dumper/t/bugs.t b/ext/Data/Dumper/t/bugs.t
new file mode 100644
index 0000000000..faa78dee36
--- /dev/null
+++ b/ext/Data/Dumper/t/bugs.t
@@ -0,0 +1,35 @@
+#!perl
+#
+# regression tests for old bugs that don't fit other categories
+
+BEGIN {
+ if ($ENV{PERL_CORE}){
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+ require Config; import Config;
+ no warnings 'once';
+ if ($Config{'extensions'} !~ /\bData\/Dumper\b/) {
+ print "1..0 # Skip: Data::Dumper was not built\n";
+ exit 0;
+ }
+ }
+}
+
+use strict;
+use Test::More tests => 1;
+use Data::Dumper;
+
+{
+ sub iterate_hash {
+ my ($h) = @_;
+ my $count = 0;
+ $count++ while each %$h;
+ return $count;
+ }
+
+ my $dumper = Data::Dumper->new( [\%ENV], ['ENV'] )->Sortkeys(1);
+ my $orig_count = iterate_hash(\%ENV);
+ $dumper->Dump;
+ my $new_count = iterate_hash(\%ENV);
+ is($new_count, $orig_count, 'correctly resets hash iterators');
+}