pass("OPTIMIZER TESTS - VAR INITIALIZATION");
+my @open_todo;
+sub open_todo {
+ if (((caller 0)[10]||{})->{open}) {
+ @open_todo = (skip => "\$^OPEN is set");
+ }
+}
+open_todo;
+
checkOptree ( name => 'sub {my $a}',
bcopts => '-exec',
code => sub {my $a},
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 1 <;> nextstate(main 45 optree.t:23) v
# 2 <0> padsv[$a:45,46] M/LVINTRO
checkOptree ( name => '-exec sub {my $a}',
bcopts => '-exec',
code => sub {my $a},
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 1 <;> nextstate(main 49 optree.t:52) v
# 2 <0> padsv[$a:49,50] M/LVINTRO
checkOptree ( name => 'sub {our $a}',
bcopts => '-exec',
code => sub {our $a},
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
1 <;> nextstate(main 21 optree.t:47) v
2 <#> gvsv[*a] s/OURINTR
checkOptree ( name => 'sub {local $a}',
bcopts => '-exec',
code => sub {local $a},
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
1 <;> nextstate(main 23 optree.t:57) v:{
2 <#> gvsv[*a] s/LVINTRO
checkOptree ( name => 'my $a',
prog => 'my $a',
bcopts => '-basic',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 4 <@> leave[1 ref] vKP/REFC ->(end)
# 1 <0> enter ->2
checkOptree ( name => 'our $a',
prog => 'our $a',
bcopts => '-basic',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
4 <@> leave[1 ref] vKP/REFC ->(end)
1 <0> enter ->2
prog => 'local $a',
errs => ['Name "main::a" used only once: possible typo at -e line 1.'],
bcopts => '-basic',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
4 <@> leave[1 ref] vKP/REFC ->(end)
1 <0> enter ->2
checkOptree ( name => 'sub {my $a=undef}',
code => sub {my $a=undef},
bcopts => '-basic',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
5 <1> leavesub[1 ref] K/REFC,1 ->(end)
- <@> lineseq KP ->5
code => sub {our $a=undef},
note => 'the global must be reset',
bcopts => '-basic',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
5 <1> leavesub[1 ref] K/REFC,1 ->(end)
- <@> lineseq KP ->5
code => sub {local $a=undef},
note => 'local not used enough to bother',
bcopts => '-basic',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
5 <1> leavesub[1 ref] K/REFC,1 ->(end)
- <@> lineseq KP ->5
checkOptree ( name => 'my $a=undef',
prog => 'my $a=undef',
bcopts => '-basic',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
6 <@> leave[1 ref] vKP/REFC ->(end)
1 <0> enter ->2
prog => 'our $a=undef',
note => 'global must be reassigned',
bcopts => '-basic',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
6 <@> leave[1 ref] vKP/REFC ->(end)
1 <0> enter ->2
errs => ['Name "main::a" used only once: possible typo at -e line 1.'],
note => 'locals are rare, probly not worth doing',
bcopts => '-basic',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
6 <@> leave[1 ref] vKP/REFC ->(end)
1 <0> enter ->2
checkOptree ( name => 'sub {my $a=()}',
code => sub {my $a=()},
bcopts => '-exec',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
1 <;> nextstate(main -439 optree.t:105) v
2 <0> stub sP
code => sub {our $a=()},
#todo => 'probly not worth doing',
bcopts => '-exec',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
1 <;> nextstate(main 31 optree.t:177) v:{
2 <0> stub sP
code => sub {local $a=()},
#todo => 'probly not worth doing',
bcopts => '-exec',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
1 <;> nextstate(main 33 optree.t:190) v:{
2 <0> stub sP
checkOptree ( name => 'my $a=()',
prog => 'my $a=()',
bcopts => '-exec',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
1 <0> enter
2 <;> nextstate(main 1 -e:1) v:{
prog => 'our $a=()',
#todo => 'probly not worth doing',
bcopts => '-exec',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
1 <0> enter
2 <;> nextstate(main 1 -e:1) v:{
errs => ['Name "main::a" used only once: possible typo at -e line 1.'],
#todo => 'probly not worth doing',
bcopts => '-exec',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
1 <0> enter
2 <;> nextstate(main 1 -e:1) v:{
prog => 'my ($a,$b)=()',
#todo => 'probly not worth doing',
bcopts => '-exec',
+ @open_todo,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# 1 <0> enter
# 2 <;> nextstate(main 1 -e:1) v:{