summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2014-09-22 14:51:01 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2014-09-22 21:01:44 -0400
commit62904ca6e0a1bd27a0f4bcbc3cdf0cde63db84a9 (patch)
tree0adb81bad11a0eb5ef951b3e665ea2c115a21cec /t
parentd3475fb81a1317499d42d46a16d7a21789b26667 (diff)
downloadperl-62904ca6e0a1bd27a0f4bcbc3cdf0cde63db84a9.tar.gz
Further tweaking for bad skip() usage.
See also e96513a2.
Diffstat (limited to 't')
-rw-r--r--t/test.pl13
1 files changed, 7 insertions, 6 deletions
diff --git a/t/test.pl b/t/test.pl
index 0cfae31b98..92f732e4db 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -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";