From 1fb3d79e119fac9dc55c8a60b2c89879ee3a1043 Mon Sep 17 00:00:00 2001 From: Slaven Rezic Date: Tue, 2 Jul 2013 17:28:28 +0200 Subject: [PATCH] adapt tests for Carp 1.25 (RT #75383) Carp 1.25 added an extra dot to the end of error messages. This change is removing this extra dot before doing any of the comparisons. That way the test suite should run both with newer and older Carp. --- t/10_slaymakefile.init/SlayMakefile.main | 1 + t/20_slaymakefile_msg.init/SlayMakefile.main | 10 +++++++--- t/30_slaymake.init/SlayMakefile.main | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/t/10_slaymakefile.init/SlayMakefile.main b/t/10_slaymakefile.init/SlayMakefile.main index 195f8c2..96748d1 100644 --- a/t/10_slaymakefile.init/SlayMakefile.main +++ b/t/10_slaymakefile.init/SlayMakefile.main @@ -31,6 +31,7 @@ test: { @OKS } $sm->parse($deps->[0]); } $sm->make; + s{(at SlayMakefile\.main line \d+)\.}{$1}g for @OUTPUT; open T, ">$target"; print T @OUTPUT; close T; diff --git a/t/20_slaymakefile_msg.init/SlayMakefile.main b/t/20_slaymakefile_msg.init/SlayMakefile.main index 260f304..2e032ba 100644 --- a/t/20_slaymakefile_msg.init/SlayMakefile.main +++ b/t/20_slaymakefile_msg.init/SlayMakefile.main @@ -23,10 +23,14 @@ test: { @OKS } my $errs = eval { $sm->parse($deps->[0]) }; open T, ">$target"; if ($errs) { - s/(SlayMakefile\.main line )\d+/${1}314159/ foreach @$errs; + s/(SlayMakefile\.main line )\d+\.?/${1}314159/ foreach @$errs; print T @$errs; } - print T $@ if $@; + if ($@) { + my $err = $@; + $err =~ s/(SlayMakefile\.main line \d+)\.?/$1/; + print T $err; + } close T; } @@ -42,7 +46,7 @@ no_targets.log: no_targets.smak push @errs, $@ if $@; open T, ">$target"; if (@errs) { - s/(SlayMakefile\.main line )\d+/${1}314159/ foreach @errs; + s/(SlayMakefile\.main line )\d+\.?/${1}314159/ foreach @errs; print T @errs; } close T; diff --git a/t/30_slaymake.init/SlayMakefile.main b/t/30_slaymake.init/SlayMakefile.main index 219568c..b636644 100644 --- a/t/30_slaymake.init/SlayMakefile.main +++ b/t/30_slaymake.init/SlayMakefile.main @@ -14,7 +14,7 @@ if $ENV{COVER}; my $flags = join ' ', @flags; $SLAYMAKE = "$^X $flags -I ../../blib/lib ../../blib/script/slaymake"; - $SANITIZE = "$^X -pe 's/(slaymake line) \\d+/\\1 314159/; s/(slaymake) \\d+(\\.\\d+)+/\\1 3.141.59/'"; + $SANITIZE = "$^X -pe 's/(slaymake line) \\d+\.?/\\1 314159/; s/(slaymake) \\d+(\\.\\d+)+/\\1 3.141.59/'"; } test: { @OKS } -- 1.7.2.5