diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-03-06 22:42:22 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-03-06 22:48:16 +0000 |
commit | bcf53fae4530fa696a6f26dd100207c224a13e89 (patch) | |
tree | 1f9f1105fd378a581eeac035f403429921703883 /t/io | |
parent | bad1036f7c06bd513a9312c5265dcaa0e82dd8b3 (diff) | |
download | perl-bcf53fae4530fa696a6f26dd100207c224a13e89.tar.gz |
Ensure that t/io/{print,read,say}.t load Errno at BEGIN time.
If Errno is loaded after the compiler has parsed the C<exists &Errno::EBADF>
later in the script, then the intent of that test is subverted - &Errno::EBADF
does not exist, at least as far as the typeglob bound to that op is concerned,
and the test for $! is skipped. I suspect that these have been skipping since
the implementation of Errno was changed in 42607a60df6df19b in May 2010 to
reduce its memory footprint by 55%.
Diffstat (limited to 't/io')
-rw-r--r-- | t/io/print.t | 5 | ||||
-rw-r--r-- | t/io/read.t | 4 | ||||
-rw-r--r-- | t/io/say.t | 6 |
3 files changed, 8 insertions, 7 deletions
diff --git a/t/io/print.t b/t/io/print.t index d29036b11d..321eb1e85b 100644 --- a/t/io/print.t +++ b/t/io/print.t @@ -3,11 +3,12 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; + require './test.pl'; + eval 'use Errno'; + die $@ if $@ and !is_miniperl(); } use strict 'vars'; -eval 'use Errno'; -die $@ if $@ and !$ENV{PERL_CORE_MINITEST}; print "1..21\n"; diff --git a/t/io/read.t b/t/io/read.t index 57e671d27c..8cc1640b59 100644 --- a/t/io/read.t +++ b/t/io/read.t @@ -4,11 +4,11 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require './test.pl'; + eval 'use Errno'; + die $@ if $@ and !is_miniperl(); } use strict; -eval 'use Errno'; -die $@ if $@ and !$ENV{PERL_CORE_MINITEST}; plan tests => 2; diff --git a/t/io/say.t b/t/io/say.t index 1da7a18d8f..ead4d0bbc9 100644 --- a/t/io/say.t +++ b/t/io/say.t @@ -3,6 +3,9 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; + require './test.pl'; + eval 'use Errno'; + die $@ if $@ and !is_miniperl(); } # Just a few very basic tests cribbed from t/io/print.t, @@ -11,9 +14,6 @@ BEGIN { # the same way as print in any case. use strict 'vars'; -eval 'use Errno'; -die $@ if $@ and !$ENV{PERL_CORE_MINITEST}; - use feature "say"; say "1..12"; |