diff options
author | Nicholas Clark <nick@ccl4.org> | 2012-06-03 15:57:20 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2012-06-18 14:15:41 +0200 |
commit | 63ffcb73631fc535f0953ece868a000c7ee9e9c0 (patch) | |
tree | faf16a4b25d4ce78de3e0be6eeaf515df4d50992 /Porting/cmpVERSION.pl | |
parent | 31c2fa87f75a985ad4493f8a830a704fa7a4f6c4 (diff) | |
download | perl-63ffcb73631fc535f0953ece868a000c7ee9e9c0.tar.gz |
In Porting/cmpVERSION.pl, increment $count in one place, unconditionally.
Previously it was only incremented if it was being used (as part of generating
TAP output). However, this was done as ++$count, necessitating using a printf
statement. By moving the increment to one place we can use print instead,
which is simpler, and avoid the risk of forgetting to increment $count if we
add a new block for different test output.
Diffstat (limited to 'Porting/cmpVERSION.pl')
-rwxr-xr-x | Porting/cmpVERSION.pl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Porting/cmpVERSION.pl b/Porting/cmpVERSION.pl index e618533a0a..51dc35bc73 100755 --- a/Porting/cmpVERSION.pl +++ b/Porting/cmpVERSION.pl @@ -146,12 +146,13 @@ foreach my $pm_file (sort keys %module_diffs) { my $pm_version = eval {MM->parse_version($pm_file)}; my $orig_pm_content = get_file_from_git($pm_file, $tag_to_compare); my $orig_pm_version = eval {MM->parse_version(\$orig_pm_content)}; + ++$count; if ((!defined $pm_version || !defined $orig_pm_version) || ($pm_version eq 'undef' || $orig_pm_version eq 'undef') # sigh || ($pm_version ne $orig_pm_version) # good ) { - printf "ok %d - %s\n", ++$count, $pm_file if $tap; + print "ok $count - $pm_file\n" if $tap; } else { if ($tap) { foreach (sort @{$module_diffs{$pm_file}}) { @@ -159,9 +160,9 @@ foreach my $pm_file (sort keys %module_diffs) { } if (exists $skip_versions{$pm_file} and grep $pm_version eq $_, @{$skip_versions{$pm_file}}) { - printf "ok %d - SKIP $pm_file version $pm_version\n", ++$count; + print "ok $count - SKIP $pm_file version $pm_version\n"; } else { - printf "not ok %d - %s\n", ++$count, $pm_file; + print "not ok $count - $pm_file\n"; } } else { push @diff, @{$module_diffs{$pm_file}}; |