This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix black Win32 smoke broken by my v5.21.1-11-g4077a6b
The problem with this was that I didn't test this on a system where $Q
was false. On those systems we not only warn about "Invalid conversion"
but also about the missing sprintf argument, as intended.
The test broke because the local __WARN__ handler would clobber the
"conversion" warning with the "missing" warning, the fix is easy, just
accumulate the warnings with ".=".
While poking at this I discovered a bug that's been here ever since the
test was added back in v5.10.0-1461-g53f65a9. If we emitted a warning on
systems where $Q was true we'd pass the test, this is because the empty
regex will match warnings, the test actually meant to use is() not
like(). It's also a bug that t/test.pl accepts non-regexes as the second
argument, Test::More doesn't:
$ perl -MTest::More -wle 'like "", ""'
not ok 1
# Failed test at -e line 1.
# '' doesn't look much like a regex to me.
# Tests were run but no plan was declared and done_testing() was not seen.
This change might cause some additional black smoke because we'll now be
detecting warnings that we previously ignored, but I don't think this'll
fail on systems where $Q is true.