summaryrefslogtreecommitdiff
path: root/dist/Data-Dumper/t
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2010-04-15 21:29:43 +0200
committerSteffen Mueller <smueller@cpan.org>2010-04-15 21:29:43 +0200
commitd34e9bd940817db5ea805b524c18753a4f24a180 (patch)
treeca2c22bbbc445d8fa3592981dac91bb06b58c967 /dist/Data-Dumper/t
parent5dec12c4fe365d1f431b0a1b786bfae24693e847 (diff)
downloadperl-d34e9bd940817db5ea805b524c18753a4f24a180.tar.gz
Fix Data::Dumper's Fix Terse(1) + Indent(2)
RT #73604: When $Data::Dumper::Terse is true, the indentation is thrown off. It appears to be acting as if the $VAR1 = is still there.
Diffstat (limited to 'dist/Data-Dumper/t')
-rw-r--r--dist/Data-Dumper/t/terse.t22
1 files changed, 22 insertions, 0 deletions
diff --git a/dist/Data-Dumper/t/terse.t b/dist/Data-Dumper/t/terse.t
new file mode 100644
index 0000000000..8d3ad48894
--- /dev/null
+++ b/dist/Data-Dumper/t/terse.t
@@ -0,0 +1,22 @@
+#!perl
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+
+use Data::Dumper;
+
+my $hash = { foo => 42 };
+
+for my $useperl (0..1) {
+ my $dumper = Data::Dumper->new([$hash]);
+ $dumper->Terse(1);
+ $dumper->Indent(2);
+ $dumper->Useperl($useperl);
+
+ is $dumper->Dump, <<'WANT', "Terse(1), Indent(2), Useperl($useperl)";
+{
+ 'foo' => 42
+}
+WANT
+}