Skip Menu |

This queue is for tickets about the ExtUtils-Constant CPAN distribution.

Report information
The Basics
Id: 132995
Status: new
Priority: 0/
Queue: ExtUtils-Constant

People
Owner: Nobody in particular
Requestors: ilmari [...] ilmari.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] Remove indirect method call in tests
Date: Mon, 13 Jul 2020 22:44:31 +0100
To: bug-ExtUtils-Constant [...] rt.cpan.org
From: ilmari [...] ilmari.org (Dagfinn Ilmari Mannsåker)
Hi, While exploring removing indirect method call syntax from the 5.33 feature bundle, I came across a test failure in ExtUtils::Constant. This is because it writes both "use $];" which enables the most recent feature bundle, and "bootstrap $package \$VERSION;" into its generated test module, which breaks if ever the 'indirect' feature is removed from the current feature bundle. The attached patch changes the bootstrap call to direct method syntax, to be forward compatible both with this, and if perl should ever completely remove support for indirect method syntax, not just from a feature bundle. - ilmari -- - Twitter seems more influential [than blogs] in the 'gets reported in the mainstream press' sense at least. - Matt McLeod - That'd be because the content of a tweet is easier to condense down to a mainstream media article. - Calle Dybedahl
From 94b5fc74c3d7ed835e83bac40632962af32f5b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org> Date: Mon, 13 Jul 2020 22:08:45 +0100 Subject: [PATCH] Fix indirect method call in ExtUtils::Constant test It puts both "use $];" and "bootstrap $package \$VERSION;" in the generated test module, which is going to break if we ever remove `indirect` from the current feature bundle. Fix by making the method call direct instead. --- t/Constant.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/Constant.t b/t/Constant.t index d6b45668da..526a32c779 100644 --- a/t/Constant.t +++ b/t/Constant.t @@ -435,7 +435,7 @@ EOT print FH ");\n"; # Print the AUTOLOAD subroutine ExtUtils::Constant generated for us print FH autoload ($package, $]); - print FH "bootstrap $package \$VERSION;\n1;\n__END__\n"; + print FH "$package->bootstrap(\$VERSION);\n1;\n__END__\n"; close FH or die "close $pm: $!\n"; ################ test.pl -- 2.26.2