develooper Front page | perl.perl5.porters | Postings from July 2016

[PATCH] fix warnings in Data::Dumper test on old perl

Thread Next
From:
Graham Knop
Date:
July 11, 2016 21:44
Subject:
[PATCH] fix warnings in Data::Dumper test on old perl
Message ID:
20160711214423.49392-1-haarg@haarg.org
Silencing the deprecated category isn't enough to quiet the warning.
The syntax category would also need to be silenced.  Instead, use a
different way of counting the lines.
---
 dist/Data-Dumper/t/indent.t | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dist/Data-Dumper/t/indent.t b/dist/Data-Dumper/t/indent.t
index bcfa251..ab50bac 100644
--- a/dist/Data-Dumper/t/indent.t
+++ b/dist/Data-Dumper/t/indent.t
@@ -98,9 +98,8 @@ like($dumpstr{ar_indent_3},
     "Indent(3) annotates array elements with their indices"
 );
 {
-    no if $] < 5.011, warnings => 'deprecated';
-    is(scalar(split("\n" => $dumpstr{ar_indent_2})) + 2,
-        scalar(split("\n" => $dumpstr{ar_indent_3})),
+    is(scalar(() = $dumpstr{ar_indent_2} =~ /\n/g) + 2,
+        scalar(() = $dumpstr{ar_indent_3} =~ /\n/g),
         "Indent(3) runs 2 lines longer than Indent(2)");
 }
 
-- 
2.9.0


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About