sub config_re {
my $re = shift;
- return map { chomp; $_ } grep /^$re=/, split /^/, $Config_SH;
+ return map { chomp; $_ } grep eval{ /^(?:$re)=/ }, split /^/, $Config_SH;
}
sub config_vars {
require "./test.pl";
}
-plan tests => 46;
+plan tests => 47;
use_ok('Config');
my $out5 = $$out;
$out->clear;
+Config::config_vars('?flags');
+my $out6 = $$out;
+$out->clear;
+
untie *STDOUT;
like($out1, qr/^cc='\Q$Config{cc}\E';/, "config_vars cc");
like($out2, qr/^d_bork='UNKNOWN';/, "config_vars d_bork is UNKNOWN");
is("'1'", $api[1], "subversion is 1");
is("'5' ", $out5, "leading and trailing colons return just the value");
+
+like($out6, qr/\bnot\s+found\b/, "config_vars with invalid regexp");
+
# Read-only.
undef $@;