From 840d003169037689159a793bb189c5991ff4bd7e Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Tue, 1 Dec 2020 16:33:07 +0000 Subject: [PATCH] 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. --- ext/POSIX/t/posix.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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: { -- 1.8.3.1