Subject: | [PATCH] .options() cannot take a false value |
I'm trying to turn off Amiga/Mac filename length checking via
options(test_amiga_length => 0, test_mac_length => 0);
However, the options() sub checks for truth of the value, not existence.
So, this fails. The attached simple patch fixes this problem.
-- Chris
Subject: | negative_options.patch |
--- /Users/chris/perl/lib/perl5/Test/Portability/Files.pm 2006-03-09 21:07:51.000000000 -0600
+++ /tmp/Files.pm 2006-09-22 23:05:12.000000000 -0500
@@ -276,12 +276,13 @@
sub options {
my %opts = @_;
for my $test (keys %tests) {
- $tests{$test} = $opts{"test_$test"} if $opts{"test_$test"}
+ $tests{$test} = $opts{"test_$test"} if exists $opts{"test_$test"}
}
for my $opt (keys %options) {
- $options{$opt} = $opts{$opt} if $opts{$opt}
+ $options{$opt} = $opts{$opt} exists if $opts{$opt}
}
- @tests{keys %tests} = (1)x(keys %tests) if $opts{all_tests};
+ @tests{keys %tests} = ($opts{all_tests})x(keys %tests)
+ if exists $opts{all_tests};
}
=item C<test_name_portability()>