X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FPOSIX%2FPOSIX.t;h=87a2aea89b9cee56ae9231ae8ca8620e56beb065;hb=894237640a8731055a749592e01318892443c38d;hp=09bd88c2a9342a45b214bb0eb10d421b624ad632;hpb=b695f709e8a342e35e482b0437eb6cdacdc58b6b;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/POSIX/POSIX.t b/ext/POSIX/POSIX.t index 09bd88c..87a2aea 100755 --- a/ext/POSIX/POSIX.t +++ b/ext/POSIX/POSIX.t @@ -10,15 +10,17 @@ BEGIN { } } -use POSIX qw(fcntl_h signal_h limits_h _exit getcwd open read strftime write); +use POSIX qw(fcntl_h signal_h limits_h _exit getcwd open read strftime write + errno); use strict subs; $| = 1; -print "1..27\n"; +print "1..29\n"; $Is_W32 = $^O eq 'MSWin32'; $Is_NetWare = $^O eq 'NetWare'; $Is_Dos = $^O eq 'dos'; +$Is_MPE = $^O eq 'mpeix'; $testfd = open("TEST", O_RDONLY, 0) and print "ok 1\n"; read($testfd, $buffer, 9) if $testfd > 2; @@ -71,9 +73,13 @@ sub SigINT { } } -print &_POSIX_OPEN_MAX > $fds[1] ? "ok 12\n" : "not ok 12\n"; +if ($Is_MPE) { + print "ok 12 # skipped, _POSIX_OPEN_MAX is inaccurate on MPE\n" +} else { + print &_POSIX_OPEN_MAX > $fds[1] ? "ok 12\n" : "not ok 12\n" +} -print getcwd() =~ m#/t$# ? "ok 13\n" : "not ok 13\n"; +print getcwd() =~ m#[/\\]t$# ? "ok 13\n" : "not ok 13\n"; # Check string conversion functions. @@ -133,7 +139,24 @@ try_strftime(26, "Wed Mar 01 00:00:00 2000 061", 0,0,0, 1,2,100); try_strftime(27, "Fri Mar 31 00:00:00 2000 091", 0,0,0, 31,2,100); &POSIX::setlocale(&POSIX::LC_TIME, $lc) if $Config{d_setlocale}; +{ + for my $test (0, 1) { + $! = 0; + # POSIX::errno is autoloaded. + # Autoloading requires many system calls. + # errno() looks at $! to generate its result. + # Autoloading should not munge the value. + my $foo = $!; + my $errno = POSIX::errno(); + print "not " unless $errno == $foo; + print "ok ", 28 + $test, "\n"; + } +} + $| = 0; # The following line assumes buffered output, which may be not true with EMX: -print '@#!*$@(!@#$' unless ($^O eq 'os2' || $^O eq 'uwin' || $^O eq 'os390'); +print '@#!*$@(!@#$' unless ($^O eq 'os2' || $^O eq 'uwin' || $^O eq 'os390' || + (defined $ENV{PERLIO} && + $ENV{PERLIO} eq 'unix' && + $Config::Config{useperlio})); _exit(0);