5 @INC = ('../lib', '../ext/B/t');
9 # import checkOptree(), and %gOpts (containing test state)
10 use OptreeCheck; # ALSO DOES @ARGV HANDLING !!!!!!
15 require_ok("B::Concise");
18 switches => ["-MO=Concise,BEGIN,CHECK,INIT,END,-exec"],
19 prog => q{$a=$b && print q/foo/},
24 my $src = q[our ($beg, $chk, $init, $end) = qq{'foo'}; BEGIN { $beg++ } CHECK { $chk++ } INIT { $init++ } END { $end++ }];
28 checkOptree ( name => 'BEGIN',
31 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
33 # b <1> leavesub[1 ref] K/REFC,1 ->(end)
34 # - <@> lineseq KP ->b
35 # 1 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 ->2
36 # 3 <1> require sK/1 ->4
37 # 2 <$> const[PV "strict.pm"] s/BARE ->3
38 # 4 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 ->5
40 # 5 <;> nextstate(B::Concise -242 Concise.pm:304) /2 ->6
41 # a <1> entersub[t1] KS*/TARG,2 ->b
42 # 6 <0> pushmark s ->7
43 # 7 <$> const[PV "strict"] sM ->8
44 # 8 <$> const[PV "refs"] sM ->9
45 # 9 <$> method_named[PVIV 1520340202] ->a
47 # m <1> leavesub[1 ref] K/REFC,1 ->(end)
48 # - <@> lineseq KP ->m
49 # c <;> nextstate(B::Concise -227 Concise.pm:327) v/2 ->d
50 # e <1> require sK/1 ->f
51 # d <$> const[PV "warnings.pm"] s/BARE ->e
52 # f <;> nextstate(B::Concise -227 Concise.pm:327) v/2 ->g
54 # g <;> nextstate(B::Concise -227 Concise.pm:327) /2 ->h
55 # l <1> entersub[t1] KS*/TARG,2 ->m
56 # h <0> pushmark s ->i
57 # i <$> const[PV "warnings"] sM ->j
58 # j <$> const[PV "qw"] sM ->k
59 # k <$> method_named[PVIV 1520340202] ->l
61 # q <1> leavesub[1 ref] K/REFC,1 ->(end)
62 # - <@> lineseq KP ->q
63 # n <;> nextstate(main 2 -e:3) v ->o
64 # p <1> postinc[t3] sK/1 ->q
65 # - <1> ex-rv2sv sKRM/1 ->p
66 # o <#> gvsv[*beg] s ->p
69 # b <1> leavesub[1 ref] K/REFC,1 ->(end)
70 # - <@> lineseq KP ->b
71 # 1 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 ->2
72 # 3 <1> require sK/1 ->4
73 # 2 <$> const(PV "strict.pm") s/BARE ->3
74 # 4 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 ->5
76 # 5 <;> nextstate(B::Concise -242 Concise.pm:304) /2 ->6
77 # a <1> entersub[t1] KS*/TARG,2 ->b
78 # 6 <0> pushmark s ->7
79 # 7 <$> const(PV "strict") sM ->8
80 # 8 <$> const(PV "refs") sM ->9
81 # 9 <$> method_named(PVIV 1520340202) ->a
83 # m <1> leavesub[1 ref] K/REFC,1 ->(end)
84 # - <@> lineseq KP ->m
85 # c <;> nextstate(B::Concise -227 Concise.pm:327) v/2 ->d
86 # e <1> require sK/1 ->f
87 # d <$> const(PV "warnings.pm") s/BARE ->e
88 # f <;> nextstate(B::Concise -227 Concise.pm:327) v/2 ->g
90 # g <;> nextstate(B::Concise -227 Concise.pm:327) /2 ->h
91 # l <1> entersub[t1] KS*/TARG,2 ->m
92 # h <0> pushmark s ->i
93 # i <$> const(PV "warnings") sM ->j
94 # j <$> const(PV "qw") sM ->k
95 # k <$> method_named(PVIV 1520340202) ->l
97 # q <1> leavesub[1 ref] K/REFC,1 ->(end)
98 # - <@> lineseq KP ->q
99 # n <;> nextstate(main 2 -e:3) v ->o
100 # p <1> postinc[t2] sK/1 ->q
101 # - <1> ex-rv2sv sKRM/1 ->p
102 # o <$> gvsv(*beg) s ->p
106 checkOptree ( name => 'END',
109 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
111 # 4 <1> leavesub[1 ref] K/REFC,1 ->(end)
112 # - <@> lineseq KP ->4
113 # 1 <;> nextstate(main 5 -e:6) v ->2
114 # 3 <1> postinc[t3] sK/1 ->4
115 # - <1> ex-rv2sv sKRM/1 ->3
116 # 2 <#> gvsv[*end] s ->3
119 # 4 <1> leavesub[1 ref] K/REFC,1 ->(end)
120 # - <@> lineseq KP ->4
121 # 1 <;> nextstate(main 5 -e:6) v ->2
122 # 3 <1> postinc[t2] sK/1 ->4
123 # - <1> ex-rv2sv sKRM/1 ->3
124 # 2 <$> gvsv(*end) s ->3
128 checkOptree ( name => 'CHECK',
131 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
133 # 4 <1> leavesub[1 ref] K/REFC,1 ->(end)
134 # - <@> lineseq KP ->4
135 # 1 <;> nextstate(main 3 -e:4) v ->2
136 # 3 <1> postinc[t3] sK/1 ->4
137 # - <1> ex-rv2sv sKRM/1 ->3
138 # 2 <#> gvsv[*chk] s ->3
141 # 4 <1> leavesub[1 ref] K/REFC,1 ->(end)
142 # - <@> lineseq KP ->4
143 # 1 <;> nextstate(main 3 -e:4) v ->2
144 # 3 <1> postinc[t2] sK/1 ->4
145 # - <1> ex-rv2sv sKRM/1 ->3
146 # 2 <$> gvsv(*chk) s ->3
150 checkOptree ( name => 'INIT',
152 #todo => 'get working',
154 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
156 # 4 <1> leavesub[1 ref] K/REFC,1 ->(end)
157 # - <@> lineseq KP ->4
158 # 1 <;> nextstate(main 4 -e:5) v ->2
159 # 3 <1> postinc[t3] sK/1 ->4
160 # - <1> ex-rv2sv sKRM/1 ->3
161 # 2 <#> gvsv[*init] s ->3
164 # 4 <1> leavesub[1 ref] K/REFC,1 ->(end)
165 # - <@> lineseq KP ->4
166 # 1 <;> nextstate(main 4 -e:5) v ->2
167 # 3 <1> postinc[t2] sK/1 ->4
168 # - <1> ex-rv2sv sKRM/1 ->3
169 # 2 <$> gvsv(*init) s ->3
173 checkOptree ( name => 'all of BEGIN END INIT CHECK -exec',
174 bcopts => [qw/ BEGIN END INIT CHECK -exec /],
175 #todo => 'get working',
177 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
179 # 1 <;> nextstate(B::Concise -242 Concise.pm:304) v/2
180 # 2 <$> const[PV "strict.pm"] s/BARE
182 # 4 <;> nextstate(B::Concise -242 Concise.pm:304) v/2
183 # 5 <;> nextstate(B::Concise -242 Concise.pm:304) /2
185 # 7 <$> const[PV "strict"] sM
186 # 8 <$> const[PV "refs"] sM
187 # 9 <$> method_named[PVIV 1520340202]
188 # a <1> entersub[t1] KS*/TARG,2
189 # b <1> leavesub[1 ref] K/REFC,1
191 # c <;> nextstate(B::Concise -227 Concise.pm:327) v/2
192 # d <$> const[PV "warnings.pm"] s/BARE
194 # f <;> nextstate(B::Concise -227 Concise.pm:327) v/2
195 # g <;> nextstate(B::Concise -227 Concise.pm:327) /2
197 # i <$> const[PV "warnings"] sM
198 # j <$> const[PV "qw"] sM
199 # k <$> method_named[PVIV 1520340202]
200 # l <1> entersub[t1] KS*/TARG,2
201 # m <1> leavesub[1 ref] K/REFC,1
203 # n <;> nextstate(main 2 -e:3) v
205 # p <1> postinc[t3] sK/1
206 # q <1> leavesub[1 ref] K/REFC,1
208 # r <;> nextstate(main 5 -e:6) v
210 # t <1> postinc[t3] sK/1
211 # u <1> leavesub[1 ref] K/REFC,1
213 # v <;> nextstate(main 4 -e:5) v
214 # w <#> gvsv[*init] s
215 # x <1> postinc[t3] sK/1
216 # y <1> leavesub[1 ref] K/REFC,1
218 # z <;> nextstate(main 3 -e:4) v
219 # 10 <#> gvsv[*chk] s
220 # 11 <1> postinc[t3] sK/1
221 # 12 <1> leavesub[1 ref] K/REFC,1
224 # 1 <;> nextstate(B::Concise -242 Concise.pm:304) v/2
225 # 2 <$> const(PV "strict.pm") s/BARE
227 # 4 <;> nextstate(B::Concise -242 Concise.pm:304) v/2
228 # 5 <;> nextstate(B::Concise -242 Concise.pm:304) /2
230 # 7 <$> const(PV "strict") sM
231 # 8 <$> const(PV "refs") sM
232 # 9 <$> method_named(PVIV 1520340202)
233 # a <1> entersub[t1] KS*/TARG,2
234 # b <1> leavesub[1 ref] K/REFC,1
236 # c <;> nextstate(B::Concise -227 Concise.pm:327) v/2
237 # d <$> const(PV "warnings.pm") s/BARE
239 # f <;> nextstate(B::Concise -227 Concise.pm:327) v/2
240 # g <;> nextstate(B::Concise -227 Concise.pm:327) /2
242 # i <$> const(PV "warnings") sM
243 # j <$> const(PV "qw") sM
244 # k <$> method_named(PVIV 1520340202)
245 # l <1> entersub[t1] KS*/TARG,2
246 # m <1> leavesub[1 ref] K/REFC,1
248 # n <;> nextstate(main 2 -e:3) v
250 # p <1> postinc[t2] sK/1
251 # q <1> leavesub[1 ref] K/REFC,1
253 # r <;> nextstate(main 5 -e:6) v
255 # t <1> postinc[t2] sK/1
256 # u <1> leavesub[1 ref] K/REFC,1
258 # v <;> nextstate(main 4 -e:5) v
259 # w <$> gvsv(*init) s
260 # x <1> postinc[t2] sK/1
261 # y <1> leavesub[1 ref] K/REFC,1
263 # z <;> nextstate(main 3 -e:4) v
264 # 10 <$> gvsv(*chk) s
265 # 11 <1> postinc[t2] sK/1
266 # 12 <1> leavesub[1 ref] K/REFC,1