From 70cbce258a2f0c602dd4e986bb1d31ec3d459158 Mon Sep 17 00:00:00 2001 From: Michiel Beijen Date: Fri, 3 Dec 2021 07:56:08 +0100 Subject: do not count tests, instead use done_testing() Having to count tests is annoying for maintainers. Also, manually updating count tests is problematic when multiple people are working on the same code; it causes merge conflicts and recounts. done_testing() is available since Test::More 0.88 which was released in 2009. This commit changes all tests under lib/ that use Test::More and were planning the number of tests. Michiel Beijen is now a Perl author --- lib/File/Basename.t | 4 +++- lib/File/Compare.t | 4 +++- lib/File/Copy.t | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/File') diff --git a/lib/File/Basename.t b/lib/File/Basename.t index 29d7d25226..785e03d54b 100644 --- a/lib/File/Basename.t +++ b/lib/File/Basename.t @@ -5,7 +5,7 @@ BEGIN { @INC = '../lib'; } -use Test::More tests => 65; +use Test::More; BEGIN { use_ok 'File::Basename' } @@ -184,3 +184,5 @@ SKIP: { ok tainted(dirname($TAINT.'/perl/lib//')); ok all_tainted(fileparse($TAINT.'/dir/draft.book7','\.book\d+')); } + +done_testing(); diff --git a/lib/File/Compare.t b/lib/File/Compare.t index b7c9d9f7be..640b181631 100644 --- a/lib/File/Compare.t +++ b/lib/File/Compare.t @@ -17,7 +17,7 @@ BEGIN { } } -use Test::More ( tests => 16 ); +use Test::More; use File::Compare qw(compare compare_text); # Upon success, compare() and compare_text() return a Unix-ish 0 @@ -132,6 +132,8 @@ SKIP: { "compare() fails: second argument undefined"); } +done_testing(); + sub get_valid_whitespace { return ' ' unless $^O eq 'VMS'; return (exists $ENV{'DECC$EFS_CHARSET'} && $ENV{'DECC$EFS_CHARSET'} =~ /^[ET1]/i) diff --git a/lib/File/Copy.t b/lib/File/Copy.t index f21c871316..57b86c1cc4 100644 --- a/lib/File/Copy.t +++ b/lib/File/Copy.t @@ -14,8 +14,6 @@ use Test::More; my $TB = Test::More->builder; -plan tests => 466; - # We are going to override rename() later on but Perl has to see an override # at compile time to honor it. BEGIN { *CORE::GLOBAL::rename = sub { CORE::rename($_[0], $_[1]) }; } @@ -521,6 +519,7 @@ SKIP: { "copy with buffer above normal size"; } +done_testing(); END { 1 while unlink "copy-$$"; -- cgit v1.2.1