3 # These tests are not necessarily normative, but until such time as we
4 # publicise an API for subclassing B::Deparse they can prevent us from
5 # gratuitously breaking conventions that CPAN modules already use.
7 use Test::More tests => 2;
11 package B::Deparse::NameMangler {
13 sub padname { SUPER::padname{@_} . '_groovy' }
16 my $nm = 'B::Deparse::NameMangler'->new;
18 like $nm->coderef2text(sub { my($a, $b, $c) }),
19 qr/\$a_groovy, \$b_groovy, \$c_groovy/,
20 'overriding padname works for renaming lexicals';
22 like $nm->coderef2text(sub { my $c; /(??{ $c })/; }),
23 qr/\Q(??{\E \$c_groovy/,
24 'overriding padname works for renaming lexicals in regexp blocks';