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;
30 my $dump = DDump
($var);
34 skip
"No UTF8 in ancient perl", 1;
37 @nl = ($dump =~ m/PV = 0x\w+ "([^"]+)".*"([^"]+)"/);
38 diag
"# This perl dumps \\n as (@nl)";
39 # Catch differences in \n
40 $dump =~ s/"ab\Q$nl[0]\E(.*?)"ab\Q$nl[1]\E/"ab\\n$1"ab\\n/;
44 $dump =~ s/\b0x[0-9a-f]+\b/0x****/g;
45 $dump =~ s/\b(REFCNT =) [0-9]{4,}/$1 -1/g;
47 $dump =~ s/\bLEN = [1-7]\b/LEN = 8/; # aligned at long long?
49 $dump =~ s/\bPADBUSY\b,?//g if $] < 5.010;
51 $dump =~ s/\bUV = /IV = /g if $] < 5.008;
52 $dump =~ s/,?\bIsUV\b//g if $] < 5.008;
55 is
($dump, $out, "DDump ($in)");
64 SV
= PV
(0x
****) at
0x
****
71 SV
= PVIV
(0x
****) at
0x
****
73 FLAGS
= (PADMY
,IOK
,pIOK
)
79 SV
= PVIV
(0x
****) at
0x
****
81 FLAGS
= (PADMY
,IOK
,pIOK
)
87 SV
= PVIV
(0x
****) at
0x
****
89 FLAGS
= (PADMY
,POK
,pPOK
)