From: David Mitchell Date: Tue, 1 Dec 2020 16:33:07 +0000 (+0000) Subject: POSIX: t/posix.t: avoid warning X-Git-Tag: v5.33.5~121 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/840d003169037689159a793bb189c5991ff4bd7e POSIX: t/posix.t: avoid warning Since warnings were enabled in this test file, skip one spurious warning being generated. S_ISBLK() is being called purely to test run-time loading; so it's being called without an arg, which now triggers an 'uninitialized value' warning. --- diff --git a/ext/POSIX/t/posix.t b/ext/POSIX/t/posix.t index 5024937..60ef36d 100644 --- a/ext/POSIX/t/posix.t +++ b/ext/POSIX/t/posix.t @@ -351,7 +351,12 @@ is ($result, undef, "fgets should fail"); like ($@, qr/^Unimplemented: POSIX::fgets\(\): Use method IO::Handle::gets\(\) instead/, "check its redef message"); -eval { use strict; POSIX->import("S_ISBLK"); my $x = S_ISBLK }; +eval { + use strict; + no warnings 'uninitialized'; # S_ISBLK normally has an arg + POSIX->import("S_ISBLK"); + my $x = S_ISBLK +}; unlike( $@, qr/Can't use string .* as a symbol ref/, "Can import autoloaded constants" ); SKIP: {