use strict;
use warnings;
-use Test::More tests => 53 * 4;
-
-use feature 'state';
+use Test::More tests => 52 * 4;
my ($obj, $pkg, $cb, $x, @a);
our $y;
-state $z;
sub meh;
{
- local $/ = "####\n";
+ local $/ = "####";
while (<DATA>) {
chomp;
s/\s*$//;
+ s/(.*?)$//m;
+ my ($skip, $prefix) = split /#+/, $1;
+ $skip = 0 unless defined $skip;
+ $prefix = '' unless defined $prefix;
+ s/\s*//;
+
+SKIP:
+ {
+ skip "$_: $skip" => 4 if eval $skip;
- local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) };
+ local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) };
- eval "die qq{ok\\n}; use indirect; $_";
- is($@, "ok\n", "use indirect: $_");
+ eval "die qq{ok\\n}; $prefix; use indirect; $_";
+ is($@, "ok\n", "use indirect: $_");
- eval "die qq{ok\n}; no indirect; $_";
- is($@, "ok\n", "no indirect: $_");
+ eval "die qq{ok\n}; $prefix; no indirect; $_";
+ is($@, "ok\n", "no indirect: $_");
- s/Hlagh/Dongs/g;
+ s/Hlagh/Dongs/g;
- eval "die qq{ok\\n}; use indirect; $_";
- is($@, "ok\n", "use indirect, defined: $_");
+ eval "die qq{ok\\n}; $prefix; use indirect; $_";
+ is($@, "ok\n", "use indirect, defined: $_");
- eval "die qq{ok\\n}; no indirect; $_";
- is($@, "ok\n", "no indirect, defined: $_");
+ eval "die qq{ok\\n}; $prefix; no indirect; $_";
+ is($@, "ok\n", "no indirect, defined: $_");
+ }
}
}
__DATA__
+
$obj = Hlagh->new;
####
$obj = Hlagh->new();
meh $y;
####
meh $y, 1, 2;
-####
+#### $] < 5.010 # use feature 'state'; state $z
meh $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
print $z;
-####
+#### $] < 5.010 # use feature 'state'; state $z
print $z "hlagh\n";
####
print STDOUT "bananananananana\n";
####
$obj = "apple @{[new Hlagh]} pear"
####
-s/dongs/new Hlagh/e;
-####
exec $x $x, @a;
####
exec { $a[0] } @a;