From: Steve Hay Date: Sun, 11 Oct 2009 23:09:51 +0000 (+0100) Subject: Fix failed() calls in t/comp X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9924e635effbf0beeff7c2e2ad828241da616e10;p=p5sagit%2Fp5-mst-13.2.git Fix failed() calls in t/comp --- diff --git a/t/comp/multiline.t b/t/comp/multiline.t index fc49484..f1e098e 100644 --- a/t/comp/multiline.t +++ b/t/comp/multiline.t @@ -27,7 +27,7 @@ sub like { # though we aren't using it here (yet). return 1; } - failed($got, $pattern); + failed($got, $pattern, $name); } sub is { @@ -37,7 +37,7 @@ sub is { print "ok $test - $name\n"; return 1; } - failed($got, "'$expect'"); + failed($got, "'$expect'", $name); } my $filename = "multiline$$"; diff --git a/t/comp/opsubs.t b/t/comp/opsubs.t index f9822e9..bfb6c3f 100644 --- a/t/comp/opsubs.t +++ b/t/comp/opsubs.t @@ -33,7 +33,7 @@ sub like { # though we aren't using it here (yet). return 1; } - failed($got, $pattern); + failed($got, $pattern, $name); } sub is { @@ -43,7 +43,7 @@ sub is { print "ok $test - $name\n"; return 1; } - failed($got, "'$expect'"); + failed($got, "'$expect'", $name); } sub isnt { @@ -53,7 +53,7 @@ sub isnt { print "ok $test - $name\n"; return 1; } - failed($got, "not '$expect'"); + failed($got, "not '$expect'", $name); } sub can_ok { @@ -125,8 +125,8 @@ can_ok( 'main', "qx" ); eval "qx('unqualified'". ($^O eq 'MSWin32' ? " 2>&1)" : ")"); TODO: { - local $::TODO = $^O eq 'MSWin32' ? "Tainting of PATH not working of Windows" : $::TODO; - like( $@, qr/^Insecure/, "qx('unqualified') doesn't work" ); + local $::TODO = $^O eq 'MSWin32' ? "Tainting of PATH not working of Windows" : $::TODO; + like( $@, qr/^Insecure/, "qx('unqualified') doesn't work" ); } is( main::qx('main'), "qx-main", "main::qx() is func" ); is( &qx('amper'), "qx-amper", "&qx() is func" ); diff --git a/t/comp/uproto.t b/t/comp/uproto.t index c899b68..6d251da 100644 --- a/t/comp/uproto.t +++ b/t/comp/uproto.t @@ -4,9 +4,9 @@ print "1..39\n"; my $test = 0; sub failed { - my ($got, $expected) = @_; + my ($got, $expected, $name) = @_; - print "not ok $test\n"; + print "not ok $test - $name\n"; my @caller = caller(1); print "# Failed test at $caller[1] line $caller[2]\n"; if (defined $got) { @@ -27,7 +27,7 @@ sub like { # though we aren't using it here (yet). return 1; } - failed($got, $pattern); + failed($got, $pattern, $name); } sub is { @@ -38,13 +38,13 @@ sub is { print "ok $test\n"; return 1; } - failed($got, "'$expect'"); + failed($got, "'$expect'", $name); } else { if (!defined $got) { print "ok $test\n"; return 1; } - failed($got, 'undef'); + failed($got, 'undef', $name); } }