diff options
author | Michael G. Schwern <schwern@pobox.com> | 2001-04-14 23:13:59 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-04-15 21:39:21 +0000 |
commit | 264cef28e9f800426234a9e31007e10cc2439aa3 (patch) | |
tree | 2bce96e47947fa15717e42374de0b6809b93618f /t/op/loopctl.t | |
parent | dd69b62cec547dc0162db14f1d9a0bb499a8fa04 (diff) | |
download | perl-264cef28e9f800426234a9e31007e10cc2439aa3.tar.gz |
Exit via last, part 1
Message-ID: <20010414221359.A413@blackrider.blackstar.co.uk>
p4raw-id: //depot/perl@9711
Diffstat (limited to 't/op/loopctl.t')
-rw-r--r-- | t/op/loopctl.t | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/t/op/loopctl.t b/t/op/loopctl.t index a7416f2046..2ed9df1432 100644 --- a/t/op/loopctl.t +++ b/t/op/loopctl.t @@ -31,7 +31,7 @@ # # -- .robin. <robin@kitsite.com> 2001-03-13 -print "1..39\n"; +print "1..41\n"; my $ok; @@ -923,3 +923,24 @@ TEST39: { } } print ($ok ? "ok 39\n" : "not ok 39\n"); + + +### Test that loop control is dynamicly scoped. + +sub test_last_label { last TEST40 } + +TEST40: { + $ok = 1; + test_last_label(); + $ok = 0; +} +print ($ok ? "ok 40\n" : "not ok 40\n"); + +sub test_last { last } + +TEST41: { + $ok = 1; + test_last(); + $ok = 0; +} +print ($ok ? "ok 41\n" : "not ok 41\n"); |