my $valstr;
{
local($s->{apad}) = $s->{apad};
- $s->{apad} .= ' ' x (length($name) + 3) if $s->{indent} >= 2;
+ $s->{apad} .= ' ' x (length($name) + 3) if $s->{indent} >= 2 and !$s->{terse};
$valstr = $s->_dump($val, $name);
}
sv_catpvn(name, tmpbuf, nchars);
}
- if (indent >= 2) {
+ if (indent >= 2 && !terse) {
SV * const tmpsv = sv_x(aTHX_ NULL, " ", 1, SvCUR(name)+3);
newapad = newSVsv(apad);
sv_catsv(newapad, tmpsv);
freezer, toaster, purity, deepcopy, quotekeys,
bless, maxdepth, sortkeys);
- if (indent >= 2)
+ if (indent >= 2 && !terse)
SvREFCNT_dec(newapad);
postlen = av_len(postav);
--- /dev/null
+#!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
+}