pass("IF,THEN,ELSE, ?:");
+my @open_todo;
+sub open_todo {
+ if (((caller 0)[10]||{})->{open}) {
+ @open_todo = (skip => "\$^OPEN is set");
+ }
+}
+open_todo;
+
checkOptree ( name => '-basic sub {if shift print then,else}',
bcopts => '-basic',
code => sub { if (shift) { print "then" }
else { print "else" }
},
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 9 <1> leavesub[1 ref] K/REFC,1 ->(end)
# - <@> lineseq KP ->9
if ($a) { print "foo" }
else { print "bar" }
},
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# d <1> leavesub[1 ref] K/REFC,1 ->(end)
# - <@> lineseq KP ->d
code => sub { if (shift) { print "then" }
else { print "else" }
},
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 1 <;> nextstate(main 426 optree.t:16) v
# 2 <#> gv[*_] s
if ($a) { print "foo" }
else { print "bar" }
},
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 1 <;> nextstate(main 423 optree.t:16) v
# 2 <#> gv[*_] s
checkOptree ( name => '-exec sub { print (shift) ? "foo" : "bar" }',
code => sub { print (shift) ? "foo" : "bar" },
bcopts => '-exec',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 1 <;> nextstate(main 428 optree.t:31) v
# 2 <0> pushmark s
checkOptree ( name => '-exec sub { foreach (1..10) {print "foo $_"} }',
code => sub { foreach (1..10) {print "foo $_"} },
bcopts => '-exec',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 1 <;> nextstate(main 443 optree.t:158) v
# 2 <0> pushmark s
checkOptree ( name => '-basic sub { print "foo $_" foreach (1..10) }',
code => sub { print "foo $_" foreach (1..10) },
bcopts => '-basic',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# h <1> leavesub[1 ref] K/REFC,1 ->(end)
# - <@> lineseq KP ->h
checkOptree ( name => '-exec -e foreach (1..10) {print qq{foo $_}}',
prog => 'foreach (1..10) {print qq{foo $_}}',
bcopts => '-exec',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 1 <0> enter
# 2 <;> nextstate(main 2 -e:1) v
checkOptree ( name => '-exec sub { print "foo $_" foreach (1..10) }',
code => sub { print "foo $_" foreach (1..10) },
bcopts => '-exec',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 1 <;> nextstate(main 445 optree.t:167) v
# 2 <;> nextstate(main 445 optree.t:167) v
checkOptree ( name => '-e use constant j => qq{junk}; print j',
prog => 'use constant j => qq{junk}; print j',
bcopts => '-exec',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 1 <0> enter
# 2 <;> nextstate(main 71 -e:1) v:{