From: Father Chrysostomos Date: Sat, 1 Jun 2013 13:28:12 +0000 (-0700) Subject: lexsub.t: To-do tests for citing lex subs after errors X-Git-Tag: upstream/5.20.0~3272 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe54d63b71ffdc66546e8a06b4ea561f58af2fc2;p=platform%2Fupstream%2Fperl.git lexsub.t: To-do tests for citing lex subs after errors This currently causes assertion failures on debugging builds. On non-debugging builds (untested), it probably crashes: my sub a { foo ref } # foo must not exist a(); --- diff --git a/t/op/lexsub.t b/t/op/lexsub.t index 86c7e26..8d768cc 100644 --- a/t/op/lexsub.t +++ b/t/op/lexsub.t @@ -8,7 +8,7 @@ BEGIN { *bar::like = *like; } no warnings 'deprecated'; -plan 128; +plan 130; # -------------------- Errors with feature disabled -------------------- # @@ -318,6 +318,15 @@ sub make_anon_with_state_sub{ } r(1); } +$::TODO = ' '; +like runperl( + switches => [ '-Mfeature=:all' ], + prog => 'state sub a { foo ref } a()', + stderr => 1 + ), + qr/syntax error/, + 'referencing a state sub after a syntax error does not crash'; +undef $::TODO; # -------------------- my -------------------- # @@ -607,6 +616,15 @@ not_lexical11(); eval q{ my sub george () { 2 } }; is $w, undef, 'no double free from constant my subs'; } +$::TODO = ' '; +like runperl( + switches => [ '-Mfeature=:all' ], + prog => 'my sub a { foo ref } a()', + stderr => 1 + ), + qr/syntax error/, + 'referencing a my sub after a syntax error does not crash'; +undef $::TODO; # -------------------- Interactions (and misc tests) -------------------- #