diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2014-09-22 14:51:01 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2014-09-22 21:01:44 -0400 |
commit | 62904ca6e0a1bd27a0f4bcbc3cdf0cde63db84a9 (patch) | |
tree | 0adb81bad11a0eb5ef951b3e665ea2c115a21cec /t | |
parent | d3475fb81a1317499d42d46a16d7a21789b26667 (diff) | |
download | perl-62904ca6e0a1bd27a0f4bcbc3cdf0cde63db84a9.tar.gz |
Further tweaking for bad skip() usage.
See also e96513a2.
Diffstat (limited to 't')
-rw-r--r-- | t/test.pl | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -477,17 +477,18 @@ sub next_test { # be compatible with Test::More::skip(). sub skip { my $why = shift; - my $n = @_ ? shift : 1; + my $n = @_ ? shift : 1; my $bad_swap; { local $^W = 0; $bad_swap = $why > 0 && $n == 0; } - if ($bad_swap) { - die qq[$0: expected skip(why, count), got skip($why, "$n")\n]; - } - if (@_) { - die qq[$0: expected skip(why, count), got skip($why, "$n", @_)\n]; + if ($bad_swap || @_) { + my $arg = "$why, '$n'"; + if (@_) { + $arg .= join(", ", '', map { qq['$_'] } @_); + } + die qq[$0: expected skip(why, count), got skip($arg)\n]; } for (1..$n) { _print "ok $test # skip $why\n"; |