diff options
author | Michael G. Schwern <schwern@pobox.com> | 2002-09-04 05:06:08 -0700 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-11-03 13:18:17 +0000 |
commit | a48f8c779b973cde21f91eb6230f57994f5c9ad9 (patch) | |
tree | 485c34265a4b0b8c7a44ccb39f3006e97a03a71a /lib/Config.t | |
parent | 60f3865b55c4d6a10a2e3a9a3b1d496422e83c3e (diff) | |
download | perl-a48f8c779b973cde21f91eb6230f57994f5c9ad9.tar.gz |
Document and test Config::config_re().
(with tweaks)
Message-ID: <20020904190607.GG8367@ool-18b93024.dyn.optonline.net>
p4raw-id: //depot/perl@18077
Diffstat (limited to 'lib/Config.t')
-rw-r--r-- | lib/Config.t | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/Config.t b/lib/Config.t index 4678769ff2..f13b40208d 100644 --- a/lib/Config.t +++ b/lib/Config.t @@ -1,10 +1,12 @@ +#!./perl + BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require "./test.pl"; } -plan tests => 29; +plan tests => 34; use_ok('Config'); @@ -50,13 +52,21 @@ ok(exists $Config{ccflags_nolargefiles}, "has ccflags_nolargefiles"); # Utility functions. -like(Config::myconfig(), qr/cc='$Config{cc}'/, "myconfig"); - -SKIP: { - skip "cc is tied in $^O", 1 if $^O eq 'MacOS'; - like(Config::config_sh(), qr/cc='$Config{cc}'/, "config_sh"); +{ + # make sure we can export what we say we can export. + package Foo; + my @exports = qw(myconfig config_sh config_vars config_re); + Config->import(@exports); + foreach my $func (@exports) { + ::ok( __PACKAGE__->can($func), "$func exported" ); + } } +like(Config::myconfig(), qr/osname=$Config{osname}/, "myconfig"); +like(Config::config_sh(), qr/osname='$Config{osname}'/, "config_sh"); +like(join("\n", Config::config_re('c.*')), + qr/^c.*?=/, 'config_re' ); + my $out = tie *STDOUT, 'FakeOut'; Config::config_vars('cc'); |