File tree Expand file tree Collapse file tree 2 files changed +25
-23
lines changed
Expand file tree Collapse file tree 2 files changed +25
-23
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ use warnings;
1111use strict;
1212use Config;
1313# plan tests => 'no_plan'; # yet
14- plan tests => 25;
14+ # plan tests => 25;
15+ plan tests => 27;
1516
1617our $TODO ;
1718
@@ -60,6 +61,26 @@ our $foo;
6061
6162# ##################
6263
64+ # Test autoloading mechanism.
65+
66+ sub two {
67+ my ($pack , $file , $line ) = caller ; # Should indicate original call stats.
68+ is(" @_ $pack $file $line " , " 1 2 3 main $: :FILE $: :LINE" ,
69+ ' autoloading mechanism.' );
70+ }
71+
72+ sub one {
73+ eval <<'END' ;
74+ no warnings 'redefine';
75+ sub one { pass('sub one'); goto &two; fail('sub one tail'); }
76+ END
77+ goto &one;
78+ }
79+
80+ $: :FILE = __FILE__ ;
81+ $: :LINE = __LINE__ + 1;
82+ &one(1,2,3);
83+
6384# deep recursion with gotos eventually caused a stack reallocation
6485# which messed up buggy internals that didn't expect the stack to move
6586
Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ use warnings;
1313use strict;
1414use Config;
1515# plan tests => 134;
16- plan tests => 110;
16+ # plan tests => 110;
17+ plan tests => 108;
1718
1819our $TODO ;
1920
@@ -80,7 +81,7 @@ fail('goto bypass');
8081exit ;
8182
8283FINALE:
83- is(curr_test(), 20 , ' FINALE' );
84+ is(curr_test(), 18 , ' FINALE' );
8485
8586# does goto LABEL handle block contexts correctly?
8687# note that this scope-hopping differs from last & next,
@@ -328,26 +329,6 @@ bypass:
328329
329330is(curr_test(), 9, ' eval "goto $x"' );
330331
331- # Test autoloading mechanism.
332-
333- sub two {
334- my ($pack , $file , $line ) = caller ; # Should indicate original call stats.
335- is(" @_ $pack $file $line " , " 1 2 3 main $: :FILE $: :LINE" ,
336- ' autoloading mechanism.' );
337- }
338-
339- sub one {
340- eval <<'END' ;
341- no warnings 'redefine';
342- sub one { pass('sub one'); goto &two; fail('sub one tail'); }
343- END
344- goto &one;
345- }
346-
347- $: :FILE = __FILE__ ;
348- $: :LINE = __LINE__ + 1;
349- &one(1,2,3);
350-
351332{
352333 my $wherever = ' NOWHERE' ;
353334 eval { goto $wherever };
You can’t perform that action at this time.
0 commit comments