summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-06-01 06:28:12 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-07-27 23:14:35 -0700
commitbf4a62f42f5451ce7caaba7891dd82801a8a0df4 (patch)
tree78d950c4f9a58fb1a19778bff8451d42326ed408 /t
parent9de5f9548e6b2b322163ba0386f30c853d6111e2 (diff)
downloadperl-bf4a62f42f5451ce7caaba7891dd82801a8a0df4.tar.gz
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(); (cherry picked from commit fe54d63b71ffdc66546e8a06b4ea561f58af2fc2)
Diffstat (limited to 't')
-rw-r--r--t/op/lexsub.t20
1 files changed, 19 insertions, 1 deletions
diff --git a/t/op/lexsub.t b/t/op/lexsub.t
index 86c7e26a14..8d768cc833 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) -------------------- #