summaryrefslogtreecommitdiff
path: root/dist/Data-Dumper
diff options
context:
space:
mode:
Diffstat (limited to 'dist/Data-Dumper')
-rw-r--r--dist/Data-Dumper/t/indent.t5
1 files changed, 3 insertions, 2 deletions
diff --git a/dist/Data-Dumper/t/indent.t b/dist/Data-Dumper/t/indent.t
index 2814f0b215..2c9d8f967c 100644
--- a/dist/Data-Dumper/t/indent.t
+++ b/dist/Data-Dumper/t/indent.t
@@ -91,10 +91,11 @@ like($dumpstr{ar_indent_3},
qr/\#0.+'foo'.+\#1.+42/s,
"Indent(3) annotates array elements with their indices"
);
+sub count_newlines { scalar $_[0] =~ tr/\n// }
{
no if $] < 5.011, warnings => 'deprecated';
- is(scalar(split("\n" => $dumpstr{ar_indent_2})) + 2,
- scalar(split("\n" => $dumpstr{ar_indent_3})),
+ is(count_newlines($dumpstr{ar_indent_2}) + 2,
+ count_newlines($dumpstr{ar_indent_3}),
"Indent(3) runs 2 lines longer than Indent(2)");
}