summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2021-09-28 07:46:07 +0000
committerNicholas Clark <nick@ccl4.org>2021-09-28 07:46:07 +0000
commit06ae5b44c128386187ab845b2ef668af86ab4c31 (patch)
treec723e2492d1f42ad7a4b626749515893088d4e6e /lib
parent32710cf2af797de8b083b5e03591807c4bf71ccb (diff)
downloadperl-06ae5b44c128386187ab845b2ef668af86ab4c31.tar.gz
Change %grandfathers to %legacy in Config.t
Also convert one ok() to cmp_ok(), and 3 uses of print to note().
Diffstat (limited to 'lib')
-rw-r--r--lib/Config.t19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/Config.t b/lib/Config.t
index abd93169ff..4a07ff58af 100644
--- a/lib/Config.t
+++ b/lib/Config.t
@@ -14,11 +14,11 @@ use strict;
# Some (safe?) bets.
-ok(keys %Config > 500, "Config has more than 500 entries");
+cmp_ok(keys %Config, '>', 500, "Config has more than 500 entries");
my ($first) = Config::config_sh() =~ /^(\S+)=/m;
die "Can't find first entry in Config::config_sh()" unless defined $first;
-print "# First entry is '$first'\n";
+note("First entry is '$first'");
# It happens that the we know what the first key should be. This is somewhat
# cheating, but there was briefly a bug where the key got a bonus newline.
@@ -31,11 +31,12 @@ ok(!exists($Config{"\n$first"}),
is($Config{PERL_REVISION}, 5, "PERL_REVISION is 5");
# Check that old config variable names are aliased to their new ones.
-my %grandfathers = ( PERL_VERSION => 'PATCHLEVEL',
- PERL_SUBVERSION => 'SUBVERSION',
- PERL_CONFIG_SH => 'CONFIG'
- );
-while( my($new, $old) = each %grandfathers ) {
+my %legacy = (
+ PERL_VERSION => 'PATCHLEVEL',
+ PERL_SUBVERSION => 'SUBVERSION',
+ PERL_CONFIG_SH => 'CONFIG'
+);
+while( my($new, $old) = each %legacy ) {
isnt($Config{$new}, undef, "$new is defined");
is($Config{$new}, $Config{$old}, "$new is aliased to $old");
}
@@ -150,7 +151,7 @@ my @api;
my @rev = @Config{qw(PERL_API_REVISION PERL_API_VERSION PERL_API_SUBVERSION)};
-print ("# test tagged responses, multi-line and single-line\n");
+note("test tagged responses, multi-line and single-line");
foreach my $api ($out3, $out4) {
@api = $api =~ /PERL_API_(\w+)=(.*?)(?:;\n|\s)/mg;
is($api[0], "REVISION", "REVISION tag");
@@ -161,7 +162,7 @@ foreach my $api ($out3, $out4) {
is($api[3], "'$rev[2]'", "SUBVERSION is $rev[2]");
}
-print("# test non-tagged responses, multi-line and single-line\n");
+note("test non-tagged responses, multi-line and single-line");
foreach my $api ($out5, $out6) {
@api = split /(?: |;\n)/, $api;
is($api[0], "'$rev[0]'", "revision is $rev[0]");