Bytecode patching from Enache.
[p5sagit/p5-mst-13.2.git] / ext / B / t / concise.t
CommitLineData
c517cc47 1#!./perl
2
3BEGIN {
4 chdir 't';
5 @INC = '../lib';
6 require './test.pl';
7}
8
62e36f8a 9plan tests => 5;
c517cc47 10
11require_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
c33fe613 18($op_base) = ($out =~ /^(\d+)\s*<0>\s*enter/m);
c517cc47 19
c33fe613 20is($op_base, 1, "Smallest OP sequence number");
c517cc47 21
c27ea44e 22($op_base_p1, $cop_base)
23 = ($out =~ /^(\d+)\s*<;>\s*nextstate\(main (-?\d+) /m);
c517cc47 24
c33fe613 25is($op_base_p1, 2, "Second-smallest OP sequence number");
26
27is($cop_base, 1, "Smallest COP sequence number");
62e36f8a 28
29# test that with -exec B::Concise navigates past logops (bug #18175)
30
31$out = runperl(
32 switches => ["-MO=Concise,-exec"],
33 prog => q{$a//=$b && print q/foo/},
34 stderr => 1,
35);
36
aa18c8dc 37like($out, qr/print/, "-exec option with //=");