diff options
author | Tony Cook <tony@develop-help.com> | 2020-11-04 09:10:43 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2020-11-04 09:10:43 +1100 |
commit | fe54cd9ca4e5c8100cd08f459eb3d35b856d0267 (patch) | |
tree | 27eef730c842bbfa25c8cd7a196ccf9ffaf396ea /ext/POSIX/t | |
parent | 16c50d0fd2977338fa7042557e826067b59e103b (diff) | |
download | perl-fe54cd9ca4e5c8100cd08f459eb3d35b856d0267.tar.gz |
ext/POSIX/t/posix.t: 0ee0b3d1 added 'use warnings', fix the warnings
locales_enabled() accepts either an optional category name, or an
arrayref of category names, and is prototyped to accept a scalar, so
the qw() was evaluated in scalar context, ignoring the "NUMERIC" and
producing a warning.
The POSIX::pipe() test is testing the POSIX::pipe() function, not
globs, so just use lexical handles.
These warnings came up while cleaning up noise in the Win32 build, but
the warnings occur on Linux too.
Useless use of a constant ("NUMERIC") in void context at t/posix.t line 358.
Name "main::WRITER" used only once: possible typo at t/posix.t line 78.
Name "main::READER" used only once: possible typo at t/posix.t line 77.
Diffstat (limited to 'ext/POSIX/t')
-rw-r--r-- | ext/POSIX/t/posix.t | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/POSIX/t/posix.t b/ext/POSIX/t/posix.t index cb4b44da0c..5024937371 100644 --- a/ext/POSIX/t/posix.t +++ b/ext/POSIX/t/posix.t @@ -74,8 +74,8 @@ SKIP: { @fds = POSIX::pipe(); cmp_ok($fds[0], '>', $testfd, 'POSIX::pipe'); - CORE::open($reader = \*READER, "<&=".$fds[0]); - CORE::open($writer = \*WRITER, ">&=".$fds[1]); + CORE::open(my $reader, "<&=".$fds[0]); + CORE::open(my $writer, ">&=".$fds[1]); my $test = next_test(); print $writer "ok $test\n"; close $writer; @@ -355,7 +355,7 @@ eval { use strict; POSIX->import("S_ISBLK"); my $x = S_ISBLK }; unlike( $@, qr/Can't use string .* as a symbol ref/, "Can import autoloaded constants" ); SKIP: { - skip("locales not available", 26) unless locales_enabled(qw(NUMERIC MONETARY)); + skip("locales not available", 26) unless locales_enabled([ qw(NUMERIC MONETARY) ]); skip("localeconv() not available", 26) unless $Config{d_locconv}; my $conv = localeconv; is(ref $conv, 'HASH', 'localeconv returns a hash reference'); |