ac26d4b4b8c55f1b01a08dbd8989ffa141b836cf
[p5sagit/p5-mst-13.2.git] / ext / B / t / concise.t
1 #!./perl
2
3 BEGIN {
4     chdir 't';
5     @INC = '../lib';
6     require './test.pl';
7 }
8
9 plan tests => 5;
10
11 require_ok("B::Concise");
12
13 $out = runperl(switches => ["-MO=Concise"], prog => '$a', stderr => 1);
14
15 # If either of the next two tests fail, it probably means you need to
16 # fix the section labeled 'fragile kludge' in Concise.pm
17
18 ($op_base) = ($out =~ /^(\d+)\s*<0>\s*enter/m);
19
20 is($op_base, 1, "Smallest OP sequence number");
21
22 ($op_base_p1, $cop_base) = ($out =~ /^(\d+)\s*<;>\s*nextstate\(main (\d+) /m);
23
24 is($op_base_p1, 2, "Second-smallest OP sequence number");
25
26 is($cop_base, 1, "Smallest COP sequence number");
27
28 # test that with -exec B::Concise navigates past logops (bug #18175)
29
30 $out = runperl(
31     switches => ["-MO=Concise,-exec"],
32     prog => q{$a//=$b && print q/foo/},
33     stderr => 1,
34 );
35
36 like($out, qr/print/, "-exec option with //=");