remove test numbers
[gitmo/Package-Stash.git] / t / impl-selection / env.t
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
4 use Test::More;
5
6 # XXX: work around dumb core segfault bug when you delete stashes
7 sub get_impl { eval '$Package::Stash::IMPLEMENTATION' }
8 sub set_impl { eval '$Package::Stash::IMPLEMENTATION = "' . $_[0] . '"' }
9
10 {
11     $ENV{PACKAGE_STASH_IMPLEMENTATION} = 'PP';
12     require Package::Stash;
13     is(get_impl, 'PP', "autodetected properly: PP");
14     can_ok('Package::Stash', 'new');
15 }
16
17 delete $Package::{'Stash::'};
18 delete $INC{'Package/Stash.pm'};
19 delete $INC{'Package/Stash/PP.pm'};
20
21 SKIP: {
22     skip "no XS", 2 unless eval "require Package::Stash::XS; 1";
23     $ENV{PACKAGE_STASH_IMPLEMENTATION} = 'XS';
24     require Package::Stash;
25     is(get_impl, 'XS', "autodetected properly: XS");
26     can_ok('Package::Stash', 'new');
27 }
28
29 done_testing;