use warnings;
use strict;
-plan tests => 57;
+plan tests => 58;
+our $TODO;
our $foo;
while ($?) {
my $r = runperl(
stderr => 1,
prog =>
-'for ($_=0;$_<3;$_++){A: if($_==1){next} if($_==2){$_++;goto A}}print qq(ok)'
+'for ($_=0;$_<3;$_++){A: if($_==1){next} if($_==2){$_++;goto A}}print qq(ok\n)'
);
- is($r, "ok", 'next and goto');
+ is($r, "ok\n", 'next and goto');
$r = runperl(
stderr => 1,
prog =>
-'for ($_=0;$_<3;$_++){A: if($_==1){$_++;redo} if($_==2){$_++;goto A}}print qq(ok)'
+'for ($_=0;$_<3;$_++){A: if($_==1){$_++;redo} if($_==2){$_++;goto A}}print qq(ok\n)'
);
- is($r, "ok", 'redo and goto');
+ is($r, "ok\n", 'redo and goto');
}
# goto &foo not allowed in evals
);
like($r, qr/bar/, "goto &foo in warn");
}
+
+TODO: {
+ local $TODO = "[perl #43403] goto() from an if to an else doesn't undo local () changes";
+ our $global = "unmodified";
+ if ($global) { # true but not constant-folded
+ local $global = "modified";
+ goto ELSE;
+ } else {
+ ELSE: is($global, "unmodified");
+ }
+}
+