From: Vincent Pit Date: Wed, 7 Aug 2013 16:05:01 +0000 (-0300) Subject: Denote B::Deparse objects in tests by $bd instead of $br X-Git-Tag: v0.06~4 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=8bc5ead0a84db8c056386248cdf5c183e8e179fb;p=perl%2Fmodules%2FB-RecDeparse.git Denote B::Deparse objects in tests by $bd instead of $br --- diff --git a/t/11-args.t b/t/11-args.t index aaa898a..c16a1c5 100644 --- a/t/11-args.t +++ b/t/11-args.t @@ -20,11 +20,11 @@ sub mul { $_[0] * $_[1] } sub fma { add mul($_[0], $_[1]), $_[2] } sub wut { fma $_[0], 2, $_[1] } -my @br_args = ('', '-sCi0v1'); +my @bd_args = ('', '-sCi0v1'); my @brd_args = ({ }, { deparse => undef }, { deparse => { } }, { deparse => [ ] }); -my $br = B::Deparse->new(); -my $reference = $br->coderef2text(\&wut); +my $bd = B::Deparse->new(); +my $reference = $bd->coderef2text(\&wut); my $i = 1; for (@brd_args) { my $brd = B::RecDeparse->new(%$_, level => 0); @@ -40,13 +40,13 @@ SKIP: { ++$i; } -my $br_opts = '-sCi0v1'; -@brd_args = ({ deparse => $br_opts }, { deparse => [ $br_opts ] }); +my $bd_opts = '-sCi0v1'; +@brd_args = ({ deparse => $bd_opts }, { deparse => [ $bd_opts ] }); for (@brd_args) { - $br = B::Deparse->new($br_opts); + $bd = B::Deparse->new($bd_opts); my $brd = B::RecDeparse->new(%$_, level => 0); my $code = $brd->coderef2text(\&wut); - is($code, $br->coderef2text(\&wut), "B::RecDeparse->new(deparse => '$br_opts' ), level => 0) does the same thing as B::Deparse->new('$br_opts') ($i)"); + is($code, $bd->coderef2text(\&wut), "B::RecDeparse->new(deparse => '$bd_opts' ), level => 0) does the same thing as B::Deparse->new('$bd_opts') ($i)"); $code = eval 'sub ' . $code; is($@, '', "result compiles ($i)"); is_deeply( [ defined $code, ref $code ], [ 1, 'CODE' ], "result compiles to a code reference ($i)"); diff --git a/t/12-level.t b/t/12-level.t index 4d4a5a7..f81d94d 100644 --- a/t/12-level.t +++ b/t/12-level.t @@ -27,21 +27,21 @@ sub which { is($code->(1, 3), wut(1, 3), "result compiles to the good thing at level $l"); } -my $br_args = '-sCi0v1'; +my $bd_args = '-sCi0v1'; -my $brd = B::RecDeparse->new(deparse => [ $br_args ], level => -1); +my $brd = B::RecDeparse->new(deparse => [ $bd_args ], level => -1); which $brd, [ ], [ qw ], -1; -$brd = B::RecDeparse->new(deparse => [ $br_args ], level => 0); +$brd = B::RecDeparse->new(deparse => [ $bd_args ], level => 0); which $brd, [ qw ], [ qw ], 0; -$brd = B::RecDeparse->new(deparse => [ $br_args ], level => 1); +$brd = B::RecDeparse->new(deparse => [ $bd_args ], level => 1); which $brd, [ qw ], [ qw ], 1; -$brd = B::RecDeparse->new(deparse => [ $br_args ], level => 2); +$brd = B::RecDeparse->new(deparse => [ $bd_args ], level => 2); which $brd, [ ], [ qw ], 2; -$brd = B::RecDeparse->new(deparse => [ $br_args ], level => 3); +$brd = B::RecDeparse->new(deparse => [ $bd_args ], level => 3); which $brd, [ ], [ qw ], 2; sub fakegv { return @_ } diff --git a/t/13-prototypes.t b/t/13-prototypes.t index 970c8a5..4d16367 100644 --- a/t/13-prototypes.t +++ b/t/13-prototypes.t @@ -27,19 +27,19 @@ sub which { is($code->(1, 3), wut(1, 3), "result compiles to the good thing at level $l"); } -my $br_args = '-sCi0v1'; +my $bd_args = '-sCi0v1'; -my $brd = B::RecDeparse->new(deparse => [ $br_args ], level => -1); +my $brd = B::RecDeparse->new(deparse => [ $bd_args ], level => -1); which $brd, [ ], [ qw ], -1; -$brd = B::RecDeparse->new(deparse => [ $br_args ], level => 0); +$brd = B::RecDeparse->new(deparse => [ $bd_args ], level => 0); which $brd, [ qw ], [ qw ], 0; -$brd = B::RecDeparse->new(deparse => [ $br_args ], level => 1); +$brd = B::RecDeparse->new(deparse => [ $bd_args ], level => 1); which $brd, [ qw ], [ qw ], 1; -$brd = B::RecDeparse->new(deparse => [ $br_args ], level => 2); +$brd = B::RecDeparse->new(deparse => [ $bd_args ], level => 2); which $brd, [ ], [ qw ], 2; -$brd = B::RecDeparse->new(deparse => [ $br_args ], level => 3); +$brd = B::RecDeparse->new(deparse => [ $bd_args ], level => 3); which $brd, [ ], [ qw ], 2; diff --git a/t/14-refs.t b/t/14-refs.t index 33dc86a..026a908 100644 --- a/t/14-refs.t +++ b/t/14-refs.t @@ -34,20 +34,20 @@ sub which { is($code->(2), $coderef->(2), "result compiles to the good thing at level $l"); } -my $br_args = '-sCi0v1'; +my $bd_args = '-sCi0v1'; -my $brd = B::RecDeparse->new(deparse => $br_args, level => -1); +my $brd = B::RecDeparse->new(deparse => $bd_args, level => -1); which $brd, \&foo, [ ], [ qw ], [ qw ], [ ], -1; which $brd, \&bar, [ ], [ qw ], [ qw ], [ ], -1; -$brd = B::RecDeparse->new(deparse => $br_args, level => 0); +$brd = B::RecDeparse->new(deparse => $bd_args, level => 0); which $brd, \&foo, [ qw ], [ qw ], [ qw ], [ qw ], 0; which $brd, \&bar, [ ], [ qw ], [ qw ], [ qw ], 0; -$brd = B::RecDeparse->new(deparse => $br_args, level => 1); +$brd = B::RecDeparse->new(deparse => $bd_args, level => 1); which $brd, \&foo, [ ], [ qw ], [ qw ], [ ], 1; which $brd, \&bar, [ ], [ qw ], [ qw ], [ ], 1; -$brd = B::RecDeparse->new(deparse => $br_args, level => 2); +$brd = B::RecDeparse->new(deparse => $bd_args, level => 2); which $brd, \&foo, [ ], [ qw ], [ qw ], [ ], 2; which $brd, \&bar, [ ], [ qw ], [ qw ], [ ], 2; diff --git a/t/15-pkg.t b/t/15-pkg.t index 3195d65..7549761 100644 --- a/t/15-pkg.t +++ b/t/15-pkg.t @@ -27,19 +27,19 @@ sub which { is($code->(1, 3), wut(1, 3), "result compiles to the good thing at level $l"); } -my $br_args = '-sCi0v1'; +my $bd_args = '-sCi0v1'; -my $brd = B::RecDeparse->new(deparse => [ $br_args ], level => -1); +my $brd = B::RecDeparse->new(deparse => [ $bd_args ], level => -1); which $brd, [ ], [ qw ], -1; -$brd = B::RecDeparse->new(deparse => [ $br_args ], level => 0); +$brd = B::RecDeparse->new(deparse => [ $bd_args ], level => 0); which $brd, [ qw ], [ qw ], 0; -$brd = B::RecDeparse->new(deparse => [ $br_args ], level => 1); +$brd = B::RecDeparse->new(deparse => [ $bd_args ], level => 1); which $brd, [ qw ], [ qw ], 1; -$brd = B::RecDeparse->new(deparse => [ $br_args ], level => 2); +$brd = B::RecDeparse->new(deparse => [ $bd_args ], level => 2); which $brd, [ ], [ qw ], 2; -$brd = B::RecDeparse->new(deparse => [ $br_args ], level => 3); +$brd = B::RecDeparse->new(deparse => [ $bd_args ], level => 3); which $brd, [ ], [ qw ], 2;