summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorAdrian M. Enache <enache@rdslink.ro>2003-02-08 23:05:14 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-02-14 22:23:56 +0000
commit33d34e4c563f3e0b3627fb43d2e2a2ef278a273a (patch)
tree453e74c03e24650bdd8b9db7a310b4c14d558560 /t
parent97605c5162d70498fbc6c6addf1e17e758cec438 (diff)
downloadperl-33d34e4c563f3e0b3627fb43d2e2a2ef278a273a.tar.gz
Re: trying to fix #20154, #20357
Message-ID: <20030208190514.GA866@ratsnest.hole> (fixes #19061 as well) p4raw-id: //depot/perl@18703
Diffstat (limited to 't')
-rwxr-xr-xt/op/goto.t35
1 files changed, 34 insertions, 1 deletions
diff --git a/t/op/goto.t b/t/op/goto.t
index a0b4d55e74..122c624324 100755
--- a/t/op/goto.t
+++ b/t/op/goto.t
@@ -2,7 +2,7 @@
# "This IS structured code. It's just randomly structured."
-print "1..22\n";
+print "1..27\n";
while ($?) {
$foo = 1;
@@ -144,6 +144,39 @@ $ok = 0 if $@;
}
print ($ok ? "ok 22\n" : "not ok 22\n");
+{
+ my $false = 0;
+
+ $ok = 0;
+ { goto A; A: $ok = 1 } continue { }
+ print "not " unless $ok;
+ print "ok 23 - #20357 goto inside /{ } continue { }/ loop\n";
+
+ $ok = 0;
+ { do { goto A; A: $ok = 1 } while $false }
+ print "not " unless $ok;
+ print "ok 24 - #20154 goto inside /do { } while ()/ loop\n";
+
+ $ok = 0;
+ foreach(1) { goto A; A: $ok = 1 } continue { };
+ print "not " unless $ok;
+ print "ok 25 - goto inside /foreach () { } continue { }/ loop\n";
+
+ $ok = 0;
+ sub a {
+ A: { if ($false) { redo A; B: $ok = 1; redo A; } }
+ goto B unless $r++
+ }
+ a();
+ print "not " unless $ok;
+ print "ok 26 - #19061 loop label wiped away by goto\n";
+
+ $ok = 0;
+ for ($p=1;$p && goto A;$p=0) { A: $ok = 1 }
+ print "not " unless $ok;
+ print "ok 27 - weird case of goto and for(;;) loop\n";
+}
+
exit;
bypass: