is($ret, $value, 'goto &$function_ref; from a sub called without arglist');
-use XS::APItest qw(mycroak);
+BEGIN {
+ use Config;
+ if ($Config{extensions} =~ m{XS/APItest}) {
+ eval q[use XS::APItest qw(mycroak); 1]
+ or die "use XS::APItest: $@\n";
+ }
+ else {
+ *mycroak = sub { die @_ };
+ }
+}
sub goto_croak { goto &mycroak }
}
# Check that we don't auto-load packages
-foreach (['powie::!', 'Errno'],
- ['powie::+', 'Tie::Hash::NamedCapture']) {
- my ($symbol, $package) = @$_;
- foreach my $scalar_first ('', '$$symbol;') {
- my $desc = qq{Referencing %{"$symbol"}};
- $desc .= qq{ after mentioning \${"$symbol"}} if $scalar_first;
- $desc .= " doesn't load $package";
-
- fresh_perl_is(<<"EOP", 0, {}, $desc);
+SKIP: {
+ skip "staticly linked; may be preloaded", 4 unless $Config{usedl};
+ foreach (['powie::!', 'Errno'],
+ ['powie::+', 'Tie::Hash::NamedCapture']) {
+ my ($symbol, $package) = @$_;
+ foreach my $scalar_first ('', '$$symbol;') {
+ my $desc = qq{Referencing %{"$symbol"}};
+ $desc .= qq{ after mentioning \${"$symbol"}} if $scalar_first;
+ $desc .= " doesn't load $package";
+
+ fresh_perl_is(<<"EOP", 0, {}, $desc);
use strict qw(vars subs);
my \$symbol = '$symbol';
$scalar_first;
1 if %{\$symbol};
print scalar %${package}::;
EOP
+ }
}
}