6 # I would like more tests, but contents change over every perl version
7 use Test
::More tests
=> 5;
11 $Data::Peek
::has_perlio
= $Data::Peek
::has_perlio
= 0;
13 ok
(1, "DDump () NOT using PerlIO");
17 chomp (@tests = <DATA
>);
20 # Determine what newlines this perl generates in sv_peek
25 foreach my $test (@tests) {
26 my ($in, $out) = split m/\n--\n/ => $test;
29 s/[\r\n]+/\n/g for $in, $out; # MSwin--
32 my $dump = DDump
($var);
36 skip
"No UTF8 in ancient perl", 1;
39 @nl = ($dump =~ m/PV = 0x\w+ "([^"]+)".*"([^"]+)"/);
40 diag
"# This perl dumps \\n as (@nl)";
41 # Catch differences in \n
42 $dump =~ s/"ab\Q$nl[0]\E(.*?)"ab\Q$nl[1]\E/"ab\\n$1"ab\\n/;
46 $dump =~ s/\b0x[0-9a-f]+\b/0x****/g;
47 $dump =~ s/\b(REFCNT =) [0-9]{4,}/$1 -1/g;
49 $dump =~ s/\bLEN = [1-7]\b/LEN = 8/; # aligned at long long?
51 $dump =~ s/\bPADBUSY\b,?//g if $] < 5.010;
53 $dump =~ s/\bUV = /IV = /g if $] < 5.008;
54 $dump =~ s/,?\bIsUV\b//g if $] < 5.008;
57 is
($dump, $out, "DDump ($in)");
66 SV
= PV
(0x
****) at
0x
****
73 SV
= PVIV
(0x
****) at
0x
****
75 FLAGS
= (PADMY
,IOK
,pIOK
)
81 SV
= PVIV
(0x
****) at
0x
****
83 FLAGS
= (PADMY
,IOK
,pIOK
)
89 SV
= PVIV
(0x
****) at
0x
****
91 FLAGS
= (PADMY
,POK
,pPOK
)