12 use Test::More tests => 74 * 8;
14 BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} }
16 my ($obj, $pkg, $cb, $x, @a);
28 local $SIG{__WARN__} = sub { push @warns, @_ };
39 my ($skip, $prefix) = split /#+/, $1;
40 $skip = 0 unless defined $skip;
41 $prefix = '' unless defined $prefix;
46 skip "$_: $skip" => 8 if eval $skip;
49 try "return; $prefix; use indirect; $_";
50 is $@, '', "use indirect: $_";
51 is @warns, 0, 'no reports';
53 try "return; $prefix; no indirect; $_";
54 is $@, '', "no indirect: $_";
55 is @warns, 0, 'no reports';
62 try "return; $prefix; use indirect; $_";
63 is $@, '', "use indirect, defined: $_";
64 is @warns, 0, 'no reports';
66 try "return; $prefix; no indirect; $_";
67 is $@, '', "no indirect, defined: $_";
68 is @warns, 0, 'no reports';
82 $obj = Hlagh->new(q{foo}, bar => $obj);
86 $obj = Hlagh -> new ( ) ;
88 $obj = Hlagh -> new ( 1 ) ;
90 $obj = Hlagh -> new ( 'foo' , bar => $obj );
113 $obj = new->new; # new new
123 $obj = Hlagh->$cb($pkg);
125 $obj = Hlagh->$cb(sub { 'foo' }, bar => $obj);
135 $obj = $pkg -> new ( );
154 $obj = $pkg -> ($cb) ();
156 $obj = $pkg->$cb( $obj );
158 $obj = $pkg->$cb(qw/foo bar baz/);
195 #### $] < 5.010 # use feature 'state'; state $z
197 #### $] < 5.010 # use feature 'state'; state $z
211 #### $] < 5.010 # use feature 'state'; state $z
213 #### $] < 5.010 # use feature 'state'; state $z
216 print STDOUT "bananananananana\n";
220 $obj = "apple ${\($x->new)} pear"
222 $obj = "apple @{[$x->new]} pear"
224 $obj = "apple ${\($y->new)} pear"
226 $obj = "apple @{[$y->new]} pear"
228 $obj = "apple ${\($x->$cb)} pear"
230 $obj = "apple @{[$x->$cb]} pear"
232 $obj = "apple ${\($y->$cb)} pear"
234 $obj = "apple @{[$y->$cb]} pear"
236 $obj = "apple ${\($x->$meth)} pear"
238 $obj = "apple @{[$x->$meth]} pear"
240 $obj = "apple ${\($y->$meth)} pear"
242 $obj = "apple @{[$y->$meth]} pear"