xref: /openbsd/gnu/usr.bin/perl/lib/Config/Extensions.t (revision 256a93a4)
1#!perl -w
2BEGIN {
3    if( $ENV{PERL_CORE} ) {
4        chdir 't' if -d 't';
5        @INC = '../lib';
6    }
7}
8use strict;
9use Test::More;
10
11BEGIN {use_ok 'Config::Extensions', '%Extensions'};
12
13use Config;
14
15my @types = qw(dynamic static nonxs);
16my %types;
17@types{@types} = @types;
18
19ok (keys %Extensions, "There are some extensions");
20# Check only the 3 valid keys have been used.
21while (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}
34
35done_testing();
36