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
authorÆvar Arnfjörð Bjarmason <avar@cpan.org>
Sat, 21 Jun 2014 16:23:29 +0000 (16:23 +0000)
committerÆvar Arnfjörð Bjarmason <avar@cpan.org>
Sat, 21 Jun 2014 16:41:32 +0000 (16:41 +0000)
commit826af139e95c118234b3f5cbaeab5d162e476795
tree5ae82cf8fde8b1a823128f4e9a5b01778db837cb
parent4077a6bc0ae42279f757dffc08ee68ba8ace9924
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.
t/op/sprintf2.t