Commit | Line | Data |
---|---|---|
3c1a32f0 NC |
1 | #!perl -w |
2 | BEGIN { | |
3 | if( $ENV{PERL_CORE} ) { | |
4 | chdir 't' if -d 't'; | |
5 | @INC = '../lib'; | |
6 | } | |
7 | } | |
8 | use strict; | |
9 | use Test::More 'no_plan'; | |
10 | ||
11 | BEGIN {use_ok 'Config::Extensions', '%Extensions'}; | |
12 | ||
13 | use Config; | |
14 | ||
15 | my @types = qw(dynamic static nonxs); | |
16 | my %types; | |
17 | @types{@types} = @types; | |
18 | ||
19 | ok (keys %Extensions, "There are some extensions"); | |
20 | # Check only the 3 valid keys have been used. | |
21 | while (my ($key, $val) = each %Extensions) { | |
22 | my $raw_ext = $key; | |
23 | # Back to the format in Config | |
24 | $raw_ext =~ s!::!/!g; | |
25 | my $re = qr/\b\Q$raw_ext\E\b/; | |
26 | like($Config{extensions}, $re, "$key was built"); | |
27 | unless ($types{$val}) { | |
28 | fail("$key is $val"); | |
29 | next; | |
30 | } | |
31 | my $type = $val . '_ext'; | |
32 | like($Config{$type}, $re, "$key is $type"); | |
33 | } |