$b->{b} = $a->[1];
$b->{c} = $a->[2];
-############# 1
+#############
##
$WANT = <<'EOT';
#$a = [
}
-############# 7
+#############
##
$WANT = <<'EOT';
#@a = (
if $XS;
}
-############# 13
+#############
##
$WANT = <<'EOT';
#%b = (
'basic test with dereferenced hash: Dumpxs()')
if $XS;
-############# 19
+#############
##
$WANT = <<'EOT';
#$a = [
}
-############# 25
+#############
##
$WANT = <<'EOT';
#$a = [
'Indent(3): Purity(0)->Quotekeys(0): Dumpxs()')
if $XS;
-############# 31
+#############
##
$WANT = <<'EOT';
#$VAR1 = [
TEST (q(Dumper($a)), 'Dumper');
TEST (q(Data::Dumper::DumperX($a)), 'DumperX') if $XS;
-############# 37
+#############
##
$WANT = <<'EOT';
#[
}
-############# 43
+#############
##
$WANT = <<'EOT';
#$VAR1 = {
$foo{d} = \%foo;
$foo[2] = \%foo;
-############# 49
+#############
##
$WANT = <<'EOT';
#$foo = \*::foo;
'Purity 1: Indent 3: Dumpxs()')
if $XS;
-############# 55
+#############
##
$WANT = <<'EOT';
#$foo = \*::foo;
'Purity 1: Indent 1: Dumpxs()')
if $XS;
-############# 61
+#############
##
$WANT = <<'EOT';
#@bar = (
'array|hash|glob dereferenced: Dumpxs()')
if $XS;
-############# 67
+#############
##
$WANT = <<'EOT';
#$bar = [
'array|hash|glob: not dereferenced: Dumpxs()')
if $XS;
-############# 73
+#############
##
$WANT = <<'EOT';
#$foo = \*::foo;
'Purity 0: Quotekeys 0: dereferenced: Dumpxs')
if $XS;
-############# 79
+#############
##
$WANT = <<'EOT';
#$foo = \*::foo;
$mutts = \%kennel;
$mutts = $mutts; # avoid warning
-############# 85
+#############
##
$WANT = <<'EOT';
#%kennels = (
'constructor: hash|array|scalar: Dumpxs()');
}
-############# 91
+#############
##
$WANT = <<'EOT';
#%kennels = %kennels;
TEST q($d->Dump), 'object call: Dump';
TEST q($d->Dumpxs), 'object call: Dumpxs' if $XS;
-############# 97
+#############
##
$WANT = <<'EOT';
#%kennels = (
TEST (q($d->Reset; $d->Dumpxs), 'Reset and Dumpxs separate calls');
}
-############# 103
+#############
##
$WANT = <<'EOT';
#@dogs = (
'constructor: array|hash|scalar: Dumpxs()');
}
-############# 109
+#############
##
TEST q($d->Reset->Dump), 'Reset Dump chained';
if ($XS) {
TEST q($d->Reset->Dumpxs), 'Reset Dumpxs chained';
}
-############# 115
+#############
##
$WANT = <<'EOT';
#@dogs = (
sub z { print "foo\n" }
$c = [ \&z ];
-############# 121
+#############
##
$WANT = <<'EOT';
#$a = $b;
'Seen: scalar: Dumpxs')
if $XS;
-############# 127
+#############
##
$WANT = <<'EOT';
#$a = \&b;
'Seen: glob: Dumpxs')
if $XS;
-############# 133
+#############
##
$WANT = <<'EOT';
#*a = \&b;
$a = [];
$a->[1] = \$a->[0];
-############# 139
+#############
##
$WANT = <<'EOT';
#@a = (
$a = \\\\\'foo';
$b = $$$a;
-############# 145
+#############
##
$WANT = <<'EOT';
#$a = \\\\\'foo';
$a = [{ a => \$b }, { b => undef }];
$b = [{ c => \$b }, { d => \$a }];
-############# 151
+#############
##
$WANT = <<'EOT';
#$a = [
$b = $a->[0][0];
$c = $${$b->[0][0]};
-############# 157
+#############
##
$WANT = <<'EOT';
#$a = [
$b = { 'c' => $c };
$a = { 'b' => $b };
-############# 163
+#############
##
$WANT = <<'EOT';
#$a = {
'Maxdepth(4): Dumpxs()')
if $XS;
-############# 169
+#############
##
$WANT = <<'EOT';
#$a = {
$a = \$a;
$b = [$a];
-############# 175
+#############
##
$WANT = <<'EOT';
#$b = [
'Purity(0): Dumpxs()')
if $XS;
-############# 181
+#############
##
$WANT = <<'EOT';
#$b = [
{
$a = "\x{09c10}";
-############# 187
+#############
## XS code was adding an extra \0
$WANT = <<'EOT';
#$a = "\x{9c10}";
$i = 0;
$a = { map { ("$_$_$_", ++$i) } 'I'..'Q' };
-############# 193
+#############
##
$WANT = <<'EOT';
#$VAR1 = {
return [ sort { $b <=> $a } keys %$hash ];
}
-############# 199
+#############
##
$WANT = <<'EOT';
#$VAR1 = {
];
}
-############# 205
+#############
##
$WANT = <<'EOT';
#$VAR1 = [
local $Data::Dumper::Deparse = 1;
local $Data::Dumper::Indent = 2;
-############# 211
+#############
##
$WANT = <<'EOT';
#$VAR1 = {
}
}
-############# 214
+#############
##
# This is messy.
{
$a = "1\n";
-############# 310
+#############
## Perl code was using /...$/ and hence missing the \n.
$WANT = <<'EOT';
my $VAR1 = '42
-2147483648,
-2147483649,
);
-############# 316
+#############
## Perl code flips over at 10 digits.
$WANT = <<'EOT';
#$VAR1 = 999999999;
}
} else {
$b = "Bad. XS didn't escape dollar sign";
-############# 322
+#############
$WANT = <<"EOT"; # Careful. This is '' string written inside "" here doc
#\$VAR1 = '\$b\"\@\\\\\xA3';
EOT
}
}
# XS used to produce "$b\"' which is 4 chars, not 3. [ie wrongly qq(\$b\\\")]
-############# 328
+#############
$WANT = <<'EOT';
#$VAR1 = '$b"';
EOT
# XS used to produce 'D'oh!' which is well, D'oh!
# Andreas found this one, which in turn discovered the previous two.
-############# 334
+#############
$WANT = <<'EOT';
#$VAR1 = 'D\'oh!';
EOT
TEST q(Data::Dumper->Dumpxs([\\%foo])),
"XS quotekeys == 0 for utf8 flagged ASCII" if $XS;
}
-############# 358
+#############
{
$WANT = <<'EOT';
#$VAR1 = [
TEST q(Data::Dumper->Dumpxs([\@foo])), 'Richard Clamp, Message-Id: <20030104005247.GA27685@mirth.demon.co.uk>: Dumpxs()'if $XS;
}
-############# 364
+#############
# Make sure $obj->Dumpxs returns the right thing in list context. This was
# broken by the initial attempt to fix [perl #74170].
$WANT = <<'EOT';
'$obj->Dumpxs in list context'
if $XS;
-############# 366
+#############
{
$WANT = <<'EOT';
#$VAR1 = [
TEST (q(Data::Dumper::DumperX($foo)), 'All latin1 characters: DumperX') if $XS;
}
-############# 372
+#############
{
$WANT = <<'EOT';
#$VAR1 = [
if $XS;
}
-############# 378
+#############
{
# If XS cannot load, the pure-Perl version cannot deparse vstrings with
# underscores properly. In 5.8.0, vstrings are just strings.
}
}
-############# 384
+#############
{
# [perl #107372] blessed overloaded globs
$WANT = <<'EOW';
TEST q(Data::Dumper->Dumpxs([\*finkle])), 'blessed overloaded globs (xs)'
if $XS;
}
-############# 390
+#############
{
# [perl #74798] uncovered behaviour
$WANT = <<'EOW';
"numbers and number-like scalars"
if $XS;
}
-############# 426
+#############
{
# [perl #82948]
# re::regexp_pattern was moved to universal.c in v5.10.0-252-g192c1e2
TEST q(Data::Dumper->Dumpxs([ qr/abc/, qr/abc/i ])), "qr// xs"
if $XS;
}
-############# 432
+#############
{
sub foo {}
TEST q(Data::Dumper->new([ \&foo, \\&foo ], [ "*a", "b" ])->Dumpxs), "name of code in *foo xs"
if $XS;
}
-############# 436
+#############