use strict;
use warnings;
-use Test::More tests => 74 * 8;
+use Test::More tests => 109 * 8 + 10;
BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} }
}
}
+# These tests must be run outside of eval to be meaningful.
+{
+ sub Zlott::Owww::new { }
+
+ my (@warns, $hook, $desc, $id);
+ BEGIN {
+ $hook = sub { push @warns, indirect::msg(@_) };
+ $desc = "test sort and line endings %d: no indirect construct";
+ $id = 1;
+ }
+
+ BEGIN { @warns = () }
+ {
+ no indirect hook => $hook;
+ my @stuff = sort Zlott::Owww
+ ->new;
+ }
+ BEGIN { is_deeply \@warns, [ ], sprintf $desc, $id++ }
+
+ BEGIN { @warns = () }
+ {
+ no indirect hook => $hook;
+ my @stuff = sort Zlott::Owww
+ ->new;
+ };
+ BEGIN { is_deeply \@warns, [ ], sprintf $desc, $id++ }
+
+ BEGIN { @warns = () }
+ {
+ no indirect hook => $hook;
+ my @stuff = sort Zlott::Owww
+ ->new;
+ }
+ BEGIN { is_deeply \@warns, [ ], sprintf $desc, $id++ }
+
+ BEGIN { @warns = () }
+ {
+ no indirect hook => $hook;
+ my @stuff = sort Zlott::Owww
+ ->new;
+ }
+ BEGIN { is_deeply \@warns, [ ], sprintf $desc, $id++ }
+
+ BEGIN { @warns = () }
+ {
+ no indirect hook => $hook;
+ my @stuff = sort Zlott::Owww
+ ->new;
+ }
+ BEGIN { is_deeply \@warns, [ ], sprintf $desc, $id++ }
+
+ BEGIN { @warns = () }
+ {
+ no indirect hook => $hook;
+ my @stuff = sort Zlott::Owww
+ ->new;
+ }
+ BEGIN { is_deeply \@warns, [ ], sprintf $desc, $id++ }
+
+ BEGIN { @warns = () }
+ {
+ no indirect hook => $hook;
+ my @stuff = sort Zlott::Owww
+ ->new;
+ }
+ BEGIN { is_deeply \@warns, [ ], sprintf $desc, $id++ }
+
+ BEGIN { @warns = () }
+ {
+ no indirect hook => $hook;
+ my @stuff = sort Zlott::Owww
+ ->new;
+ }
+ BEGIN { is_deeply \@warns, [ ], sprintf $desc, $id++ }
+
+ BEGIN { @warns = () }
+ {
+ no indirect hook => $hook;
+ my @stuff = sort Zlott::Owww
+ ->new;
+ }
+ BEGIN { is_deeply \@warns, [ ], sprintf $desc, $id++ }
+
+ BEGIN { @warns = () }
+ {
+ no indirect hook => $hook;
+ my @stuff = sort Zlott::Owww
+ ->new;
+ }
+ BEGIN { is_deeply \@warns, [ ], sprintf $desc, $id++ }
+}
+
__DATA__
$obj = Hlagh->new;
####
$obj = $pkg->$cb( $obj );
####
-$obj = $pkg->$cb(qw/foo bar baz/);
+$obj = $pkg->$cb(qw<foo bar baz>);
####
$obj = $pkg->$meth;
####
meh $y;
####
meh $y, 1, 2;
-#### $] < 5.010 # use feature 'state'; state $z
+#### "$]" < 5.010 # use feature 'state'; state $z
meh $z;
-#### $] < 5.010 # use feature 'state'; state $z
+#### "$]" < 5.010 # use feature 'state'; state $z
meh $z, 1, 2;
####
print;
print $y;
####
print $y "dongs\n";
-#### $] < 5.010 # use feature 'state'; state $z
+#### "$]" < 5.010 # use feature 'state'; state $z
print $z;
-#### $] < 5.010 # use feature 'state'; state $z
+#### "$]" < 5.010 # use feature 'state'; state $z
print $z "hlagh\n";
####
print STDOUT "bananananananana\n";
$obj = "apple ${\($y->$meth)} pear"
####
$obj = "apple @{[$y->$meth]} pear"
+#### # local $_ = "foo";
+s/foo/return; Hlagh->new/e;
+#### # local $_ = "bar";
+s/foo/return; Hlagh->new/e;
+#### # local $_ = "foo";
+s/foo/return; Hlagh->$cb/e;
+#### # local $_ = "bar";
+s/foo/return; Hlagh->$cb/e;
+#### # local $_ = "foo";
+s/foo/return; Hlagh->$meth/e;
+#### # local $_ = "bar";
+s/foo/return; Hlagh->$meth/e;
+#### # local $_ = "foo";
+s/foo/return; $x->new/e;
+#### # local $_ = "bar";
+s/foo/return; $x->new/e;
+#### # local $_ = "foo";
+s/foo/return; $x->$cb/e;
+#### # local $_ = "bar";
+s/foo/return; $x->$cb/e;
+#### # local $_ = "foo";
+s/foo/return; $x->$meth/e;
+#### # local $_ = "bar";
+s/foo/return; $x->$meth/e;
+#### # local $_ = "foo";
+s/foo/return; $y->new/e;
+#### # local $_ = "bar";
+s/foo/return; $y->new/e;
+#### # local $_ = "foo";
+s/foo/return; $y->$cb/e;
+#### # local $_ = "bar";
+s/foo/return; $y->$cb/e;
+#### # local $_ = "foo";
+s/foo/return; $y->$meth/e;
+#### # local $_ = "bar";
+s/foo/return; $y->$meth/e;
+####
+"foo" =~ /(?{Hlagh->new})/;
+####
+"foo" =~ /(?{Hlagh->$cb})/;
+####
+"foo" =~ /(?{Hlagh->$meth})/;
+####
+"foo" =~ /(?{$x->new})/;
+####
+"foo" =~ /(?{$x->$cb})/;
+####
+"foo" =~ /(?{$x->$meth})/;
+####
+"foo" =~ /(?{$y->new})/;
+####
+"foo" =~ /(?{$y->$cb})/;
+####
+"foo" =~ /(?{$y->$meth})/;
####
exec $x $x, @a;
####
zap { 1; 1; };
####
zap { zap { }; 1; };
+####
+my @stuff = sort Hlagh
+ ->new;
+####
+my @stuff = sort Hlagh
+ ->new;
+####
+my @stuff = sort Hlagh
+ ->new;
+####
+my @stuff = sort Hlagh
+ ->new;
+####
+my @stuff = sort Hlagh
+ ->new;
+####
+my @stuff = sort Hlagh
+ ->new;
+####
+my @stuff = sort Hlagh
+ ->new;
+####
+my @stuff = sort Hlagh
+ ->new;