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/},
25 our ($beg, $chk, $init, $end) = "'foo'";
34 checkOptree ( name => 'BEGIN',
37 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
39 # b <1> leavesub[1 ref] K/REFC,1 ->(end)
40 # - <@> lineseq KP ->b
41 # 1 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 ->2
42 # 3 <1> require sK/1 ->4
43 # 2 <$> const[PV "strict.pm"] s/BARE ->3
44 # 4 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 ->5
46 # 5 <;> nextstate(B::Concise -242 Concise.pm:304) /2 ->6
47 # a <1> entersub[t1] KS*/TARG,2 ->b
48 # 6 <0> pushmark s ->7
49 # 7 <$> const[PV "strict"] sM ->8
50 # 8 <$> const[PV "refs"] sM ->9
51 # 9 <$> method_named[PVIV 1520340202] ->a
53 # m <1> leavesub[1 ref] K/REFC,1 ->(end)
54 # - <@> lineseq KP ->m
55 # c <;> nextstate(B::Concise -227 Concise.pm:327) v/2 ->d
56 # e <1> require sK/1 ->f
57 # d <$> const[PV "warnings.pm"] s/BARE ->e
58 # f <;> nextstate(B::Concise -227 Concise.pm:327) v/2 ->g
60 # g <;> nextstate(B::Concise -227 Concise.pm:327) /2 ->h
61 # l <1> entersub[t1] KS*/TARG,2 ->m
62 # h <0> pushmark s ->i
63 # i <$> const[PV "warnings"] sM ->j
64 # j <$> const[PV "qw"] sM ->k
65 # k <$> method_named[PVIV 1520340202] ->l
67 # q <1> leavesub[1 ref] K/REFC,1 ->(end)
68 # - <@> lineseq KP ->q
69 # n <;> nextstate(main 2 -e:3) v ->o
70 # p <1> postinc[t3] sK/1 ->q
71 # - <1> ex-rv2sv sKRM/1 ->p
72 # o <#> gvsv[*beg] s ->p
75 # b <1> leavesub[1 ref] K/REFC,1 ->(end)
76 # - <@> lineseq KP ->b
77 # 1 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 ->2
78 # 3 <1> require sK/1 ->4
79 # 2 <$> const(PV "strict.pm") s/BARE ->3
80 # 4 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 ->5
82 # 5 <;> nextstate(B::Concise -242 Concise.pm:304) /2 ->6
83 # a <1> entersub[t1] KS*/TARG,2 ->b
84 # 6 <0> pushmark s ->7
85 # 7 <$> const(PV "strict") sM ->8
86 # 8 <$> const(PV "refs") sM ->9
87 # 9 <$> method_named(PVIV 1520340202) ->a
89 # m <1> leavesub[1 ref] K/REFC,1 ->(end)
90 # - <@> lineseq KP ->m
91 # c <;> nextstate(B::Concise -227 Concise.pm:327) v/2 ->d
92 # e <1> require sK/1 ->f
93 # d <$> const(PV "warnings.pm") s/BARE ->e
94 # f <;> nextstate(B::Concise -227 Concise.pm:327) v/2 ->g
96 # g <;> nextstate(B::Concise -227 Concise.pm:327) /2 ->h
97 # l <1> entersub[t1] KS*/TARG,2 ->m
98 # h <0> pushmark s ->i
99 # i <$> const(PV "warnings") sM ->j
100 # j <$> const(PV "qw") sM ->k
101 # k <$> method_named(PVIV 1520340202) ->l
103 # q <1> leavesub[1 ref] K/REFC,1 ->(end)
104 # - <@> lineseq KP ->q
105 # n <;> nextstate(main 2 -e:3) v ->o
106 # p <1> postinc[t2] sK/1 ->q
107 # - <1> ex-rv2sv sKRM/1 ->p
108 # o <$> gvsv(*beg) s ->p
112 checkOptree ( name => 'END',
115 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
117 # 4 <1> leavesub[1 ref] K/REFC,1 ->(end)
118 # - <@> lineseq KP ->4
119 # 1 <;> nextstate(main 5 -e:6) v ->2
120 # 3 <1> postinc[t3] sK/1 ->4
121 # - <1> ex-rv2sv sKRM/1 ->3
122 # 2 <#> gvsv[*end] s ->3
125 # 4 <1> leavesub[1 ref] K/REFC,1 ->(end)
126 # - <@> lineseq KP ->4
127 # 1 <;> nextstate(main 5 -e:6) v ->2
128 # 3 <1> postinc[t2] sK/1 ->4
129 # - <1> ex-rv2sv sKRM/1 ->3
130 # 2 <$> gvsv(*end) s ->3
134 checkOptree ( name => 'CHECK',
137 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
139 # 4 <1> leavesub[1 ref] K/REFC,1 ->(end)
140 # - <@> lineseq KP ->4
141 # 1 <;> nextstate(main 3 -e:4) v ->2
142 # 3 <1> postinc[t3] sK/1 ->4
143 # - <1> ex-rv2sv sKRM/1 ->3
144 # 2 <#> gvsv[*chk] s ->3
147 # 4 <1> leavesub[1 ref] K/REFC,1 ->(end)
148 # - <@> lineseq KP ->4
149 # 1 <;> nextstate(main 3 -e:4) v ->2
150 # 3 <1> postinc[t2] sK/1 ->4
151 # - <1> ex-rv2sv sKRM/1 ->3
152 # 2 <$> gvsv(*chk) s ->3
156 checkOptree ( name => 'INIT',
158 #todo => 'get working',
160 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
162 # 4 <1> leavesub[1 ref] K/REFC,1 ->(end)
163 # - <@> lineseq KP ->4
164 # 1 <;> nextstate(main 4 -e:5) v ->2
165 # 3 <1> postinc[t3] sK/1 ->4
166 # - <1> ex-rv2sv sKRM/1 ->3
167 # 2 <#> gvsv[*init] s ->3
170 # 4 <1> leavesub[1 ref] K/REFC,1 ->(end)
171 # - <@> lineseq KP ->4
172 # 1 <;> nextstate(main 4 -e:5) v ->2
173 # 3 <1> postinc[t2] sK/1 ->4
174 # - <1> ex-rv2sv sKRM/1 ->3
175 # 2 <$> gvsv(*init) s ->3
179 checkOptree ( name => 'all of BEGIN END INIT CHECK -exec',
180 bcopts => [qw/ BEGIN END INIT CHECK -exec /],
181 #todo => 'get working',
183 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
185 # 1 <;> nextstate(B::Concise -242 Concise.pm:304) v/2
186 # 2 <$> const[PV "strict.pm"] s/BARE
188 # 4 <;> nextstate(B::Concise -242 Concise.pm:304) v/2
189 # 5 <;> nextstate(B::Concise -242 Concise.pm:304) /2
191 # 7 <$> const[PV "strict"] sM
192 # 8 <$> const[PV "refs"] sM
193 # 9 <$> method_named[PVIV 1520340202]
194 # a <1> entersub[t1] KS*/TARG,2
195 # b <1> leavesub[1 ref] K/REFC,1
197 # c <;> nextstate(B::Concise -227 Concise.pm:327) v/2
198 # d <$> const[PV "warnings.pm"] s/BARE
200 # f <;> nextstate(B::Concise -227 Concise.pm:327) v/2
201 # g <;> nextstate(B::Concise -227 Concise.pm:327) /2
203 # i <$> const[PV "warnings"] sM
204 # j <$> const[PV "qw"] sM
205 # k <$> method_named[PVIV 1520340202]
206 # l <1> entersub[t1] KS*/TARG,2
207 # m <1> leavesub[1 ref] K/REFC,1
209 # n <;> nextstate(main 2 -e:3) v
211 # p <1> postinc[t3] sK/1
212 # q <1> leavesub[1 ref] K/REFC,1
214 # r <;> nextstate(main 5 -e:6) v
216 # t <1> postinc[t3] sK/1
217 # u <1> leavesub[1 ref] K/REFC,1
219 # v <;> nextstate(main 4 -e:5) v
220 # w <#> gvsv[*init] s
221 # x <1> postinc[t3] sK/1
222 # y <1> leavesub[1 ref] K/REFC,1
224 # z <;> nextstate(main 3 -e:4) v
225 # 10 <#> gvsv[*chk] s
226 # 11 <1> postinc[t3] sK/1
227 # 12 <1> leavesub[1 ref] K/REFC,1
230 # 1 <;> nextstate(B::Concise -242 Concise.pm:304) v/2
231 # 2 <$> const(PV "strict.pm") s/BARE
233 # 4 <;> nextstate(B::Concise -242 Concise.pm:304) v/2
234 # 5 <;> nextstate(B::Concise -242 Concise.pm:304) /2
236 # 7 <$> const(PV "strict") sM
237 # 8 <$> const(PV "refs") sM
238 # 9 <$> method_named(PVIV 1520340202)
239 # a <1> entersub[t1] KS*/TARG,2
240 # b <1> leavesub[1 ref] K/REFC,1
242 # c <;> nextstate(B::Concise -227 Concise.pm:327) v/2
243 # d <$> const(PV "warnings.pm") s/BARE
245 # f <;> nextstate(B::Concise -227 Concise.pm:327) v/2
246 # g <;> nextstate(B::Concise -227 Concise.pm:327) /2
248 # i <$> const(PV "warnings") sM
249 # j <$> const(PV "qw") sM
250 # k <$> method_named(PVIV 1520340202)
251 # l <1> entersub[t1] KS*/TARG,2
252 # m <1> leavesub[1 ref] K/REFC,1
254 # n <;> nextstate(main 2 -e:3) v
256 # p <1> postinc[t2] sK/1
257 # q <1> leavesub[1 ref] K/REFC,1
259 # r <;> nextstate(main 5 -e:6) v
261 # t <1> postinc[t2] sK/1
262 # u <1> leavesub[1 ref] K/REFC,1
264 # v <;> nextstate(main 4 -e:5) v
265 # w <$> gvsv(*init) s
266 # x <1> postinc[t2] sK/1
267 # y <1> leavesub[1 ref] K/REFC,1
269 # z <;> nextstate(main 3 -e:4) v
270 # 10 <$> gvsv(*chk) s
271 # 11 <1> postinc[t2] sK/1
272 # 12 <1> leavesub[1 ref] K/REFC,1