summaryrefslogtreecommitdiff
path: root/lib/File
diff options
context:
space:
mode:
authorMichiel Beijen <mb@x14.nl>2021-12-03 07:56:08 +0100
committerMichiel Beijen <mb@x14.nl>2021-12-04 15:55:55 +0100
commit70cbce258a2f0c602dd4e986bb1d31ec3d459158 (patch)
treecac900e71152888dba2c76b0974db2d87ab49e09 /lib/File
parente728f790bcefcaf1d8b42e2f7ee16a9125f0af22 (diff)
downloadperl-70cbce258a2f0c602dd4e986bb1d31ec3d459158.tar.gz
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
Diffstat (limited to 'lib/File')
-rw-r--r--lib/File/Basename.t4
-rw-r--r--lib/File/Compare.t4
-rw-r--r--lib/File/Copy.t3
3 files changed, 7 insertions, 4 deletions
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-$$";