diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-03-08 10:46:14 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-03-08 10:46:14 +0000 |
commit | 77ba2250b324d4fdc54cedfc356f3197ea6cc717 (patch) | |
tree | abdb0a19ccef6d31455fdc7ee7722b173066ecd9 /t/test.pl | |
parent | 4f018ed094fde8223d458959a30ea42ff841f880 (diff) | |
download | perl-77ba2250b324d4fdc54cedfc356f3197ea6cc717.tar.gz |
Refactor skip_all_without_config() to take a list of config options to test.
Previously it took a second argument as a reason to show in the skip_all
message, if the config option was not set. However, no callers were using it,
so remove it. This allows skip_all_without_config() to take a list of keys
to test, which is useful to two of its callers.
Diffstat (limited to 't/test.pl')
-rw-r--r-- | t/test.pl | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -137,18 +137,17 @@ sub skip_all_without_perlio { } sub skip_all_without_config { - my ($key, $reason) = @_; unless (eval 'require Config; 1') { warn "test.pl had problems loading Config: $@"; return; } - return if $Config::Config{$key}; - unless (defined $reason) { + foreach (@_) { + next if $Config::Config{$_}; + my $key = $_; # Need to copy, before trying to modify. $key =~ s/^use//; $key =~ s/^d_//; - $reason = "no $key"; + skip_all("no $key"); } - skip_all($reason); } sub _ok { |