Skip to content

Commit c18964b

Browse files
committed
Move 7 more tests
1 parent add6949 commit c18964b

File tree

2 files changed

+24
-25
lines changed

2 files changed

+24
-25
lines changed

t/op/goto-amp-name.t

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ use warnings;
1111
use strict;
1212
use Config;
1313
#plan tests => 'no_plan'; # yet
14-
#plan tests => 25;
15-
plan tests => 27;
14+
plan tests => 34;
1615

1716
our $TODO;
1817

@@ -61,6 +60,27 @@ our $foo;
6160

6261
###################
6362

63+
# see if a modified @_ propagates
64+
{
65+
my $i;
66+
package Foo;
67+
sub DESTROY { my $s = shift; ::is($s->[0], $i, "destroy $i"); }
68+
sub show { ::is(+@_, 5, "show $i",); }
69+
sub start { push @_, 1, "foo", {}; goto &show; }
70+
for (1..3) { $i = $_; start(bless([$_]), 'bar'); }
71+
}
72+
73+
sub auto {
74+
goto &loadit;
75+
}
76+
my $ok;
77+
78+
sub AUTOLOAD { $ok = 1 if "@_" eq "foo" }
79+
80+
$ok = 0;
81+
auto("foo");
82+
ok($ok, 'autoload');
83+
6484
# Test autoloading mechanism.
6585

6686
sub two {

t/op/goto.t

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ use warnings;
1313
use strict;
1414
use Config;
1515
#plan tests => 134;
16-
#plan tests => 110;
17-
plan tests => 108;
16+
plan tests => 101;
1817

1918
our $TODO;
2019

@@ -81,7 +80,7 @@ fail('goto bypass');
8180
exit;
8281

8382
FINALE:
84-
is(curr_test(), 18, 'FINALE');
83+
is(curr_test(), 11, 'FINALE');
8584

8685
# does goto LABEL handle block contexts correctly?
8786
# note that this scope-hopping differs from last & next,
@@ -335,26 +334,6 @@ is(curr_test(), 9, 'eval "goto $x"');
335334
like($@, qr/Can't find label NOWHERE/, 'goto NOWHERE sets $@');
336335
}
337336

338-
# see if a modified @_ propagates
339-
{
340-
my $i;
341-
package Foo;
342-
sub DESTROY { my $s = shift; ::is($s->[0], $i, "destroy $i"); }
343-
sub show { ::is(+@_, 5, "show $i",); }
344-
sub start { push @_, 1, "foo", {}; goto &show; }
345-
for (1..3) { $i = $_; start(bless([$_]), 'bar'); }
346-
}
347-
348-
sub auto {
349-
goto &loadit;
350-
}
351-
352-
sub AUTOLOAD { $ok = 1 if "@_" eq "foo" }
353-
354-
$ok = 0;
355-
auto("foo");
356-
ok($ok, 'autoload');
357-
358337
{
359338
my $wherever = 'FINALE';
360339
goto $wherever;

0 commit comments

Comments
 (0)