summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/ext/POSIX/t
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/ext/POSIX/t')
-rw-r--r--gnu/usr.bin/perl/ext/POSIX/t/sysconf.t2
-rw-r--r--gnu/usr.bin/perl/ext/POSIX/t/unimplemented.t6
-rw-r--r--gnu/usr.bin/perl/ext/POSIX/t/usage.t10
3 files changed, 10 insertions, 8 deletions
diff --git a/gnu/usr.bin/perl/ext/POSIX/t/sysconf.t b/gnu/usr.bin/perl/ext/POSIX/t/sysconf.t
index f23e0d3b3b9..29cf20f2102 100644
--- a/gnu/usr.bin/perl/ext/POSIX/t/sysconf.t
+++ b/gnu/usr.bin/perl/ext/POSIX/t/sysconf.t
@@ -110,7 +110,7 @@ SKIP: {
-c $TTY
or skip("$TTY not a character file", $n);
- open(TTY, $TTY)
+ open(TTY, '<', $TTY)
or skip("failed to open $TTY: $!", $n);
-t TTY
or skip("TTY ($TTY) not a terminal file", $n);
diff --git a/gnu/usr.bin/perl/ext/POSIX/t/unimplemented.t b/gnu/usr.bin/perl/ext/POSIX/t/unimplemented.t
index 2d8f8198319..6ee85f683da 100644
--- a/gnu/usr.bin/perl/ext/POSIX/t/unimplemented.t
+++ b/gnu/usr.bin/perl/ext/POSIX/t/unimplemented.t
@@ -83,15 +83,17 @@ foreach ([atexit => 'C-specific: use END {} instead'],
[strspn => 'C-specific, stopped'],
[strtok => 'C-specific, stopped'],
[tmpfile => \'IO::File::new_tmpfile'],
+ [tmpnam => \'use File::Temp'],
[ungetc => \'IO::Handle::ungetc'],
[vfprintf => 'C-specific, stopped'],
[vprintf => 'C-specific, stopped'],
[vsprintf => 'C-specific, stopped'],
+ [L_tmpnam => 'C-specific, stopped'],
) {
my ($func, $action) = @$_;
my $expect = ref $action
- ? qr/Use method $$action\(\) instead of POSIX::$func\(\) at \(eval/
- : qr/Unimplemented: POSIX::$func\(\) is \Q$action\E at \(eval/;
+ ? qr/Unimplemented: POSIX::$func\(\): .*$$action(?:\(\))? instead at \(eval/
+ : qr/Unimplemented: POSIX::$func\(\): \Q$action\E at \(eval/;
is(eval "POSIX::$func(); 1", undef, "POSIX::$func fails as expected");
like($@, $expect, "POSIX::$func gives expected error message");
}
diff --git a/gnu/usr.bin/perl/ext/POSIX/t/usage.t b/gnu/usr.bin/perl/ext/POSIX/t/usage.t
index 24e6a7e9163..8aba55c9cb9 100644
--- a/gnu/usr.bin/perl/ext/POSIX/t/usage.t
+++ b/gnu/usr.bin/perl/ext/POSIX/t/usage.t
@@ -18,7 +18,7 @@ for my $list ([qw(errno fork getchar getegid geteuid getgid getgroups getlogin
[qw(abs alarm assert chdir closedir cos exit exp fabs fstat getc
getenv getgrgid getgrnam getpwnam getpwuid gmtime isatty
localtime log opendir raise readdir remove rewind rewinddir
- rmdir sin sleep sqrt stat strerror system tolower toupper
+ rmdir sin sleep sqrt stat strerror system
umask unlink)],
[qw(atan2 chmod creat kill link mkdir pow rename strstr waitpid)],
[qw(chown fcntl utime)]) {
@@ -32,10 +32,10 @@ foreach my $func (sort @all) {
my $arg_pat = join ', ', ('[a-z]+') x $valid{$func};
my $expect = qr/\AUsage: POSIX::$func\($arg_pat\) at \(eval/;
foreach my $try (@try) {
- next if $valid{$func} == $try;
- my $call = "POSIX::$func(" . join(', ', 1 .. $try) . ')';
- is(eval "$call; 1", undef, "$call fails");
- like($@, $expect, "POSIX::$func for $try arguments gives expected error")
+ next if $valid{$func} == $try;
+ my $call = "POSIX::$func(" . join(', ', 1 .. $try) . ')';
+ is(eval "$call; 1", undef, "$call fails");
+ like($@, $expect, "POSIX::$func for $try arguments gives expected error")
}
}