5 unshift @INC, '../lib';
17 sub ok { print "ok $test\n"; $test++ }
20 my $deparse = B::Deparse->new() or print "not ";
23 print "not " if "{\n 1;\n}" ne $deparse->coderef2text(sub {1});
26 print "not " if "{\n '???';\n 2;\n}" ne
27 $deparse->coderef2text(sub {1;2});
30 print "not " if "{\n \$test /= 2 if ++\$test;\n}" ne
31 $deparse->coderef2text(sub {++$test and $test/=2;});
34 my $a = `$^X -I../lib -MO=Deparse -anle 1 2>&1`;
35 $a =~ s/-e syntax OK\n//g;
38 LINE: while (defined($_ = <ARGV>)) {
40 @F = split(/\s+/, $_, 0);
48 print "# [$a]\n\# vs\n# [$b]\nnot " if $a ne $b;
52 $a = `$^X -I../lib -MO=Debug -e 1 2>&1`;
53 print "not " unless $a =~
54 /\bLISTOP\b.*\bOP\b.*\bCOP\b.*\bOP\b/s;
58 $a = `$^X -I../lib -MO=Terse -e 1 2>&1`;
59 print "not " unless $a =~
60 /\bLISTOP\b.*leave.*\bOP\b.*enter.*\bCOP\b.*nextstate.*\bOP\b.*null/s;
63 $a = `$^X -I../lib -MO=Terse -ane "s/foo/bar/" 2>&1`;
64 $a =~ s/\(0x[^)]+\)//g;
65 $a =~ s/\[[^\]]+\]//g;
66 $a =~ s/-e syntax OK//;
69 $a =~ s/\b(s|foo|bar|ullsv)\b\s?//g;
73 leave enter nextstate label leaveloop enterloop null and defined null
74 null gvsv readline gv lineseq nextstate aassign null pushmark split pushre
75 null gvsv const null pushmark rvav gv nextstate subst const unstack
78 $b=~s/\n/ /g;$b=~s/\s+/ /g;
80 print "# [$a] vs [$b]\nnot " if $a ne $b;
83 chomp($a = `$^X -I../lib -MB::Stash -Mwarnings -e1`);
84 $a = join ',', sort split /,/, $a;
86 if ($Config{static_ext} eq ' ') {
87 $b = '-uCarp,-uCarp::Heavy,-uDB,-uExporter,-uExporter::Heavy,-uattributes,'
88 . '-umain,-uwarnings';
89 print "# [$a] vs [$b]\nnot " if $a ne $b;
92 print "ok $test # skipped: one or more static extensions\n"; $test++;
95 $a = `$^X -I../lib -MO=Showlex -e "my %one" 2>&1`;
96 print "# [$a]\nnot " unless $a =~ /sv_undef.*PVNV.*%one.*sv_undef.*HV/s;