This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add synonym \p{Titlecase}
[perl5.git] / lib / Config / Extensions.t
CommitLineData
3c1a32f0
NC
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 'no_plan';
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}