X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F02-pp.t;h=35e3d85c595bddfa2c84433c451edab46856ef6b;hb=HEAD;hp=a4d5f0faf6443aa062e4d5e64e4467b677acac30;hpb=858989a385e838e44a21a7b5b4d46ed933f8cbb2;p=perl%2Fmodules%2FScalar-Vec-Util.git diff --git a/t/02-pp.t b/t/02-pp.t index a4d5f0f..35e3d85 100644 --- a/t/02-pp.t +++ b/t/02-pp.t @@ -3,23 +3,24 @@ use strict; use warnings; -use Config qw/%Config/; +use Config qw<%Config>; use Test::More tests => 4; BEGIN { - my $re = join '|', - grep defined && length, - @Config{qw/myarchname archname/}, 'arch'; - my @inc = @INC; - @INC = grep !/(?:$re)$/, @INC; - require Scalar::Vec::Util; - Scalar::Vec::Util->import(qw/vfill vcopy veq SVU_PP/); - @INC = @inc; + require XSLoader; + my $xsloader_load_orig = \&XSLoader::load; + no warnings 'redefine'; + *XSLoader::load = sub { + die if $_[0] eq 'Scalar::Vec::Util'; + goto $xsloader_load_orig; + }; } -is(SVU_PP, 1, 'using pure perl subroutines'); -for (qw/vfill vcopy veq/) { +use Scalar::Vec::Util qw; + +is SVU_PP, 1, 'using pure perl subroutines'; +for (qw) { no strict 'refs'; - is(*{$_}{CODE}, *{'Scalar::Vec::Util::'.$_}{CODE}, $_ .' is ' . $_ . '_pp'); + is *{$_}{CODE}, *{'Scalar::Vec::Util::'.$_}{CODE}, $_ .' is ' . $_ . '_pp'; }