diff options
author | Jim Cromie <jcromie@cpan.org> | 2005-01-02 23:36:16 -0700 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-01-07 14:30:51 +0000 |
commit | 09e96b99c215ed417c37d0d188dd576c5464c72a (patch) | |
tree | f0311897e0c6eb6d473caa496bbc83165704599f /ext/B/t/optree_specials.t | |
parent | 5df617be18e4372550725f3369e8e3fd641cce19 (diff) | |
download | perl-09e96b99c215ed417c37d0d188dd576c5464c72a.tar.gz |
Re: [PATCH] Remove Carp from warnings.pm
Message-ID: <cfe85dfa05010305367445dee6@mail.gmail.com>
p4raw-id: //depot/perl@23768
Diffstat (limited to 'ext/B/t/optree_specials.t')
-rw-r--r-- | ext/B/t/optree_specials.t | 196 |
1 files changed, 75 insertions, 121 deletions
diff --git a/ext/B/t/optree_specials.t b/ext/B/t/optree_specials.t index dda1adcc3d..67053c1a65 100644 --- a/ext/B/t/optree_specials.t +++ b/ext/B/t/optree_specials.t @@ -1,5 +1,12 @@ #!./perl +# This tests the B:: module(s) with CHECK, BEGIN, END and INIT blocks. The +# text excerpts below marked with "# " in front are the expected output. They +# are there twice, EOT for threading, and EONT for a non-threading Perl. The +# output is matched losely. If the match fails even though the "got" and +# "expected" output look exactly the same, then watch for trailing, invisible +# spaces. + BEGIN { if ($ENV{PERL_CORE}){ chdir('t') if -d 't'; @@ -39,7 +46,6 @@ my $out = runperl( my $src = q[our ($beg, $chk, $init, $end) = qq{'foo'}; BEGIN { $beg++ } CHECK { $chk++ } INIT { $init++ } END { $end++ }]; - checkOptree ( name => 'BEGIN', bcopts => 'BEGIN', prog => $src, @@ -47,74 +53,46 @@ checkOptree ( name => 'BEGIN', # BEGIN 1: # b <1> leavesub[1 ref] K/REFC,1 ->(end) # - <@> lineseq KP ->b -# 1 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 ->2 +# 1 <;> nextstate(B::Concise -234 Concise.pm:328) v/2 ->2 # 3 <1> require sK/1 ->4 -# 2 <$> const[PV "strict.pm"] s/BARE ->3 -# 4 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 ->5 +# 2 <$> const[PV "warnings.pm"] s/BARE ->3 +# 4 <;> nextstate(B::Concise -234 Concise.pm:328) v/2 ->5 # - <@> lineseq K ->- -# 5 <;> nextstate(B::Concise -242 Concise.pm:304) /2 ->6 +# 5 <;> nextstate(B::Concise -234 Concise.pm:328) /2 ->6 # a <1> entersub[t1] KS*/TARG,2 ->b # 6 <0> pushmark s ->7 -# 7 <$> const[PV "strict"] sM ->8 -# 8 <$> const[PV "refs"] sM ->9 +# 7 <$> const[PV "warnings"] sM ->8 +# 8 <$> const[PV "qw"] sM ->9 # 9 <$> method_named[PVIV 1520340202] ->a # BEGIN 2: -# m <1> leavesub[1 ref] K/REFC,1 ->(end) -# - <@> lineseq KP ->m -# c <;> nextstate(B::Concise -227 Concise.pm:327) v/2 ->d -# e <1> require sK/1 ->f -# d <$> const[PV "warnings.pm"] s/BARE ->e -# f <;> nextstate(B::Concise -227 Concise.pm:327) v/2 ->g -# - <@> lineseq K ->- -# g <;> nextstate(B::Concise -227 Concise.pm:327) /2 ->h -# l <1> entersub[t1] KS*/TARG,2 ->m -# h <0> pushmark s ->i -# i <$> const[PV "warnings"] sM ->j -# j <$> const[PV "qw"] sM ->k -# k <$> method_named[PVIV 1520340202] ->l -# BEGIN 3: -# q <1> leavesub[1 ref] K/REFC,1 ->(end) -# - <@> lineseq KP ->q -# n <;> nextstate(main 2 -e:3) v ->o -# p <1> postinc[t3] sK/1 ->q -# - <1> ex-rv2sv sKRM/1 ->p -# o <#> gvsv[*beg] s ->p +# f <1> leavesub[1 ref] K/REFC,1 ->(end) +# - <@> lineseq KP ->f +# c <;> nextstate(main 2 -e:1) v ->d +# e <1> postinc[t3] sK/1 ->f +# - <1> ex-rv2sv sKRM/1 ->e +# d <#> gvsv[*beg] s ->e EOT_EOT # BEGIN 1: # b <1> leavesub[1 ref] K/REFC,1 ->(end) # - <@> lineseq KP ->b -# 1 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 ->2 +# 1 <;> nextstate(B::Concise -234 Concise.pm:328) v/2 ->2 # 3 <1> require sK/1 ->4 -# 2 <$> const(PV "strict.pm") s/BARE ->3 -# 4 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 ->5 +# 2 <$> const(PV "warnings.pm") s/BARE ->3 +# 4 <;> nextstate(B::Concise -234 Concise.pm:328) v/2 ->5 # - <@> lineseq K ->- -# 5 <;> nextstate(B::Concise -242 Concise.pm:304) /2 ->6 +# 5 <;> nextstate(B::Concise -234 Concise.pm:328) /2 ->6 # a <1> entersub[t1] KS*/TARG,2 ->b # 6 <0> pushmark s ->7 -# 7 <$> const(PV "strict") sM ->8 -# 8 <$> const(PV "refs") sM ->9 +# 7 <$> const(PV "warnings") sM ->8 +# 8 <$> const(PV "qw") sM ->9 # 9 <$> method_named(PVIV 1520340202) ->a # BEGIN 2: -# m <1> leavesub[1 ref] K/REFC,1 ->(end) -# - <@> lineseq KP ->m -# c <;> nextstate(B::Concise -227 Concise.pm:327) v/2 ->d -# e <1> require sK/1 ->f -# d <$> const(PV "warnings.pm") s/BARE ->e -# f <;> nextstate(B::Concise -227 Concise.pm:327) v/2 ->g -# - <@> lineseq K ->- -# g <;> nextstate(B::Concise -227 Concise.pm:327) /2 ->h -# l <1> entersub[t1] KS*/TARG,2 ->m -# h <0> pushmark s ->i -# i <$> const(PV "warnings") sM ->j -# j <$> const(PV "qw") sM ->k -# k <$> method_named(PVIV 1520340202) ->l -# BEGIN 3: -# q <1> leavesub[1 ref] K/REFC,1 ->(end) -# - <@> lineseq KP ->q -# n <;> nextstate(main 2 -e:3) v ->o -# p <1> postinc[t2] sK/1 ->q -# - <1> ex-rv2sv sKRM/1 ->p -# o <$> gvsv(*beg) s ->p +# f <1> leavesub[1 ref] K/REFC,1 ->(end) +# - <@> lineseq KP ->f +# c <;> nextstate(main 2 -e:1) v ->d +# e <1> postinc[t2] sK/1 ->f +# - <1> ex-rv2sv sKRM/1 ->e +# d <$> gvsv(*beg) s ->e EONT_EONT @@ -191,92 +169,68 @@ checkOptree ( name => 'all of BEGIN END INIT CHECK -exec', prog => $src, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); # BEGIN 1: -# 1 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 -# 2 <$> const[PV "strict.pm"] s/BARE +# 1 <;> nextstate(B::Concise -234 Concise.pm:328) v/2 +# 2 <$> const[PV "warnings.pm"] s/BARE # 3 <1> require sK/1 -# 4 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 -# 5 <;> nextstate(B::Concise -242 Concise.pm:304) /2 +# 4 <;> nextstate(B::Concise -234 Concise.pm:328) v/2 +# 5 <;> nextstate(B::Concise -234 Concise.pm:328) /2 # 6 <0> pushmark s -# 7 <$> const[PV "strict"] sM -# 8 <$> const[PV "refs"] sM +# 7 <$> const[PV "warnings"] sM +# 8 <$> const[PV "qw"] sM # 9 <$> method_named[PVIV 1520340202] # a <1> entersub[t1] KS*/TARG,2 # b <1> leavesub[1 ref] K/REFC,1 # BEGIN 2: -# c <;> nextstate(B::Concise -227 Concise.pm:327) v/2 -# d <$> const[PV "warnings.pm"] s/BARE -# e <1> require sK/1 -# f <;> nextstate(B::Concise -227 Concise.pm:327) v/2 -# g <;> nextstate(B::Concise -227 Concise.pm:327) /2 -# h <0> pushmark s -# i <$> const[PV "warnings"] sM -# j <$> const[PV "qw"] sM -# k <$> method_named[PVIV 1520340202] -# l <1> entersub[t1] KS*/TARG,2 -# m <1> leavesub[1 ref] K/REFC,1 -# BEGIN 3: -# n <;> nextstate(main 2 -e:3) v -# o <#> gvsv[*beg] s -# p <1> postinc[t3] sK/1 -# q <1> leavesub[1 ref] K/REFC,1 +# c <;> nextstate(main 2 -e:1) v +# d <#> gvsv[*beg] s +# e <1> postinc[t3] sK/1 +# f <1> leavesub[1 ref] K/REFC,1 # END 1: -# r <;> nextstate(main 5 -e:6) v -# s <#> gvsv[*end] s -# t <1> postinc[t3] sK/1 -# u <1> leavesub[1 ref] K/REFC,1 +# g <;> nextstate(main 5 -e:1) v +# h <#> gvsv[*end] s +# i <1> postinc[t3] sK/1 +# j <1> leavesub[1 ref] K/REFC,1 # INIT 1: -# v <;> nextstate(main 4 -e:5) v -# w <#> gvsv[*init] s -# x <1> postinc[t3] sK/1 -# y <1> leavesub[1 ref] K/REFC,1 +# k <;> nextstate(main 4 -e:1) v +# l <#> gvsv[*init] s +# m <1> postinc[t3] sK/1 +# n <1> leavesub[1 ref] K/REFC,1 # CHECK 1: -# z <;> nextstate(main 3 -e:4) v -# 10 <#> gvsv[*chk] s -# 11 <1> postinc[t3] sK/1 -# 12 <1> leavesub[1 ref] K/REFC,1 +# o <;> nextstate(main 3 -e:1) v +# p <#> gvsv[*chk] s +# q <1> postinc[t3] sK/1 +# r <1> leavesub[1 ref] K/REFC,1 EOT_EOT # BEGIN 1: -# 1 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 -# 2 <$> const(PV "strict.pm") s/BARE +# 1 <;> nextstate(B::Concise -234 Concise.pm:328) v/2 +# 2 <$> const(PV "warnings.pm") s/BARE # 3 <1> require sK/1 -# 4 <;> nextstate(B::Concise -242 Concise.pm:304) v/2 -# 5 <;> nextstate(B::Concise -242 Concise.pm:304) /2 +# 4 <;> nextstate(B::Concise -234 Concise.pm:328) v/2 +# 5 <;> nextstate(B::Concise -234 Concise.pm:328) /2 # 6 <0> pushmark s -# 7 <$> const(PV "strict") sM -# 8 <$> const(PV "refs") sM +# 7 <$> const(PV "warnings") sM +# 8 <$> const(PV "qw") sM # 9 <$> method_named(PVIV 1520340202) # a <1> entersub[t1] KS*/TARG,2 # b <1> leavesub[1 ref] K/REFC,1 # BEGIN 2: -# c <;> nextstate(B::Concise -227 Concise.pm:327) v/2 -# d <$> const(PV "warnings.pm") s/BARE -# e <1> require sK/1 -# f <;> nextstate(B::Concise -227 Concise.pm:327) v/2 -# g <;> nextstate(B::Concise -227 Concise.pm:327) /2 -# h <0> pushmark s -# i <$> const(PV "warnings") sM -# j <$> const(PV "qw") sM -# k <$> method_named(PVIV 1520340202) -# l <1> entersub[t1] KS*/TARG,2 -# m <1> leavesub[1 ref] K/REFC,1 -# BEGIN 3: -# n <;> nextstate(main 2 -e:3) v -# o <$> gvsv(*beg) s -# p <1> postinc[t2] sK/1 -# q <1> leavesub[1 ref] K/REFC,1 +# c <;> nextstate(main 2 -e:1) v +# d <$> gvsv(*beg) s +# e <1> postinc[t2] sK/1 +# f <1> leavesub[1 ref] K/REFC,1 # END 1: -# r <;> nextstate(main 5 -e:6) v -# s <$> gvsv(*end) s -# t <1> postinc[t2] sK/1 -# u <1> leavesub[1 ref] K/REFC,1 +# g <;> nextstate(main 5 -e:1) v +# h <$> gvsv(*end) s +# i <1> postinc[t2] sK/1 +# j <1> leavesub[1 ref] K/REFC,1 # INIT 1: -# v <;> nextstate(main 4 -e:5) v -# w <$> gvsv(*init) s -# x <1> postinc[t2] sK/1 -# y <1> leavesub[1 ref] K/REFC,1 +# k <;> nextstate(main 4 -e:1) v +# l <$> gvsv(*init) s +# m <1> postinc[t2] sK/1 +# n <1> leavesub[1 ref] K/REFC,1 # CHECK 1: -# z <;> nextstate(main 3 -e:4) v -# 10 <$> gvsv(*chk) s -# 11 <1> postinc[t2] sK/1 -# 12 <1> leavesub[1 ref] K/REFC,1 +# o <;> nextstate(main 3 -e:1) v +# p <$> gvsv(*chk) s +# q <1> postinc[t2] sK/1 +# r <1> leavesub[1 ref] K/REFC,1 EONT_EONT |