This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Deparse: better handle BEGIN { use_ok() }
authorDavid Mitchell <davem@iabyn.com>
Fri, 24 Feb 2017 16:11:34 +0000 (16:11 +0000)
committerDavid Mitchell <davem@iabyn.com>
Mon, 5 Jun 2017 11:52:18 +0000 (12:52 +0100)
commit7a4a81c99a2e1dd2397d2007137a2290ddcdfb73
treeb3ef26b2b6c3fc5b380fcf5548b584590f4e8f9a
parent82ab48fa8c6c51b80c9b69419850061640110339
Deparse: better handle BEGIN { use_ok() }

Commit v5.25.3-111-g8071973 added handling for the bad deparsing of

    BEGIN { use_ok() }

Basically by stripping out the bad code text *after* it had been deparsed.
However, this didn't catch all bad cases - in particular, where #line
directives got added:

    use Socket (@{
    #line 10 "t/000_load.t"
    $args[0];});

Under TEST -deparse, this fixes the following unexpectedly failing
scripts:

    ../cpan/Term-ANSIColor/t/taint/basic.t
    ../cpan/autodie/t/00-load.t
    ../dist/Locale-Maketext/t/01_about_verbose.t
    ../dist/Locale-Maketext/t/10_make.t
    ../dist/Locale-Maketext/t/20_get.t
    ../dist/Locale-Maketext/t/40_super.t
    ../dist/Locale-Maketext/t/50_super.t
    ../dist/Locale-Maketext/t/60_super.t
    ../dist/Locale-Maketext/t/70_fail_auto.t
    ../dist/Locale-Maketext/t/91_backslash.t
    ../ext/File-Glob/t/taint.t
    ../ext/Hash-Util/t/Util.t
    ../lib/DB.t
    ../lib/File/Basename.t

and fixes the following expected-to-fail script:

    ../dist/Net-Ping/t/000_load.t
Porting/deparse-skips.txt
lib/B/Deparse.pm