Loosen the passing requirement for a regex.
authorJames E Keenan <jkeenan@cpan.org>
Thu, 28 Feb 2013 01:19:54 +0000 (20:19 -0500)
committerJames E Keenan <jkeenan@cpan.org>
Thu, 28 Feb 2013 01:38:07 +0000 (20:38 -0500)
RT #116961: Olivier Menguéreported many test failures when installing
Data-Dumper v2.43 on pre-5.16.0 versions of Perl.  This patch addresses only
one of those issues by relaxing what is expected in a pattern match:
'42' vs. 42.  It doesn't matter for the test in question because what we are
testing is the "annotation" of array elements with their indices.

dist/Data-Dumper/t/indent.t

index dd736be..90a3be0 100644 (file)
@@ -94,17 +94,9 @@ $dumpstr{ar_indent_3} = _dumptostr($dumper);
 isnt($dumpstr{ar_indent_2}, $dumpstr{ar_indent_3},
     "On arrays, Indent(2) is different from Indent(3)");
 like($dumpstr{ar_indent_3},
-    qr/\#0.+'foo'.+\#1.+'42'/s,
+    qr/\#0.+'foo'.+\#1.+42/s,
     "Indent(3) annotates array elements with their indices"
 );
 is(scalar(split("\n" => $dumpstr{ar_indent_2})) + 2,
     scalar(split("\n" => $dumpstr{ar_indent_3})),
     "Indent(3) runs 2 lines longer than Indent(2)");
-
-__END__
-is($dumpstr{noindent}, $dumpstr{indent_0},
-    "absence of Indent is same as Indent(0)");
-isnt($dumpstr{noindent}, $dumpstr{indent_1},
-    "absence of Indent is different from Indent(1)");
-print STDERR $dumpstr{indent_0};
-print STDERR $dumpstr{ar_indent_3};