summaryrefslogtreecommitdiff
path: root/lib/Config.t
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2002-09-04 05:06:08 -0700
committerhv <hv@crypt.org>2002-11-03 13:18:17 +0000
commita48f8c779b973cde21f91eb6230f57994f5c9ad9 (patch)
tree485c34265a4b0b8c7a44ccb39f3006e97a03a71a /lib/Config.t
parent60f3865b55c4d6a10a2e3a9a3b1d496422e83c3e (diff)
downloadperl-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.t22
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');