6 # I would like more tests, but contents change over every perl version
7 use Test
::More tests
=> 6;
12 $Data::Peek
::has_perlio
= $Data::Peek
::has_perlio
= 0;
14 ok
(1, "DDump () NOT using PerlIO");
18 chomp (@tests = <DATA
>);
21 # Determine what newlines this perl generates in sv_peek
26 foreach my $test (@tests) {
27 my ($in, $out) = split m/\n--\n/ => $test;
31 my $dump = DDump
($var);
35 skip
"No UTF8 in ancient perl", 1;
38 @nl = ($dump =~ m/PV = 0x\w+ "([^"]+)".*"([^"]+)"/);
39 diag
"# This perl dumps \\n as (@nl)";
40 # Catch differences in \n
41 $dump =~ s/"ab\Q$nl[0]\E(.*?)"ab\Q$nl[1]\E/"ab\\n$1"ab\\n/;
45 $dump =~ s/\b0x[0-9a-f]+\b/0x****/g;
46 $dump =~ s/\b(REFCNT =) [0-9]{4,}/$1 -1/g;
48 $dump =~ s/\bLEN = (?:[1-9]|1[0-6])\b/LEN = 8/; # aligned at long long?
50 $dump =~ s/\bPADBUSY\b,?//g if $] < 5.010;
52 $dump =~ s/\bUV = /IV = /g if $] < 5.008;
53 $dump =~ s/,?\bIsUV\b//g if $] < 5.008;
57 is
($dump, $out, "DDump ($in)");
66 SV
= PV
(0x
****) at
0x
****
75 SV
= PVIV
(0x
****) at
0x
****
77 FLAGS
= (PADMY
,IOK
,pIOK
)
85 SV
= PVIV
(0x
****) at
0x
****
87 FLAGS
= (PADMY
,IOK
,pIOK
)
95 SV
= PVIV
(0x
****) at
0x
****
97 FLAGS
= (PADMY
,POK
,pPOK
)