From 0c88af1e483c135a9870bf1dcf39afb07da80bfb Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Thu, 20 Jul 2023 13:18:51 +0200 Subject: [PATCH] t/real-export-setup.t - fix broken test in SETUPALT This test calls Test::SubExport::SETUPALT->import(":all") but there is not such method defined, and only works because Perl special cases the handling of a missing import() method to not throw an exception, thus making such calls a no-op. This no-op behavior simulates what would happen if there was a UNIVERSAL::import() method that does nothing. In 5.39.0 Perl added a UNIVERSAL::import() method which throws an error if it is passed an argument, as the argument will be ignored, and this pattern is usually indicitive of a usage error, especially on case insensitive file systems. This then breaks this test. This patch could also simply remove the call to import() but that would make the code look a bit odd. Instead we use the import function provided by Exporter, and define an "all" tag with no symbols in it. --- t/real-export-setup.t | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t/real-export-setup.t b/t/real-export-setup.t index de6b4f9..a8acc96 100644 --- a/t/real-export-setup.t +++ b/t/real-export-setup.t @@ -136,6 +136,9 @@ for my $iteration (1..2) { { package Test::SubExporter::SETUPALT; + use Exporter qw(import); + our %EXPORT_TAGS = ( "all" => [] ); + use Sub::Exporter -setup => { -as => 'alternimport', exports => [ qw(Y) ],