From: Craig A. Berry Date: Thu, 11 Jun 2009 12:12:57 +0000 (-0500) Subject: Some portability and clean-up for errno.t. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fcac5cf14997b354a7158a10465a31469cf66656;p=p5sagit%2Fp5-mst-13.2.git Some portability and clean-up for errno.t. --- diff --git a/t/io/errno.t b/t/io/errno.t index b55e3db..6294ed7 100644 --- a/t/io/errno.t +++ b/t/io/errno.t @@ -10,17 +10,28 @@ require './test.pl'; plan( tests => 16 ); my $test_prog = 'while(<>){print}; print $!'; +my $saved_perlio; + +BEGIN { + $saved_perlio = $ENV{PERLIO}; +} +END { + delete $ENV{PERLIO}; + $ENV{PERLIO} = $saved_perlio if defined $saved_perlio; +} for my $perlio ('perlio', 'stdio') { $ENV{PERLIO} = $perlio; +SKIP: for my $test_in ("test\n", "test") { + skip("Guaranteed newline at EOF on VMS", 4) if $^O eq 'VMS' && $test_in eq 'test'; my $test_in_esc = $test_in; $test_in_esc =~ s/\n/\\n/g; for my $rs_code ('', '$/=undef', '$/=\2', '$/=\1024') { is( runperl( prog => "$rs_code; $test_prog", stdin => $test_in, stderr => 1), $test_in, - "Wrong errno, PERLIO=$ENV{PERLIO} stdin='$test_in_esc'"); + "Wrong errno, PERLIO=$ENV{PERLIO} stdin='$test_in_esc', $rs_code"); } - } + } }