3 # regression tests for old bugs that don't fit other categories
8 unshift @INC, '../lib';
9 require Config; import Config;
11 if ($Config{'extensions'} !~ /\bData\/Dumper\b/) {
12 print "1..0 # Skip: Data::Dumper was not built\n";
19 use Test::More tests => 5;
26 $count++ while each %$h;
30 my $dumper = Data::Dumper->new( [\%ENV], ['ENV'] )->Sortkeys(1);
31 my $orig_count = iterate_hash(\%ENV);
33 my $new_count = iterate_hash(\%ENV);
34 is($new_count, $orig_count, 'correctly resets hash iterators');
37 # [perl #38612] Data::Dumper core dump in 5.8.6, fixed by 5.8.7
40 local $Data::Dumper::Terse = 1;
41 my $c = eval Dumper($s);
44 my $d = Data::Dumper->new([$c]);
49 ok(1, "[perl #38612]"); # Still no core dump? We are fine.
55 my $d = Data::Dumper->new([\%h]);
60 is_deeply($VAR1, \%h, '[perl #40668] Reset hash iterator');
63 # [perl #64744] Data::Dumper each() bad interaction
65 local $Data::Dumper::Useqq = 1;
66 my $a = {foo => 1, bar => 1};
70 my $d = Data::Dumper->new([$a]);
75 is_deeply($VAR1, $a, '[perl #64744] Reset hash iterator');
78 # [perl #56766] Segfaults on bad syntax - fixed with version 2.121_17
81 # 2nd arg is supposed to be an arrayref
82 my $doh = Data::Dumper->Dump([\@_],'@_');
85 ok(1, "[perl #56766]"); # Still no core dump? We are fine.