This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=2a0d833974f98ac12915de450f7644c03a74769e

commit 2a0d833974f98ac12915de450f7644c03a74769e
Author: Guillem Jover <[email protected]>
AuthorDate: Thu Sep 18 23:36:03 2025 +0200

    test: Hardcode number of invariant tests instead of dynamically computing 
them
    
    The numbers become cryptic and is harder to know what to update. Simply
    list the total number which only changes when new tests get added and is
    trivial to update from the TAP error.
---
 lib/dpkg/t/t-trigdeferred.t   | 4 +---
 scripts/t/Dpkg_Version.t      | 4 +---
 utils/t/update_alternatives.t | 8 ++------
 3 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/lib/dpkg/t/t-trigdeferred.t b/lib/dpkg/t/t-trigdeferred.t
index ca39e39f2..75d6b8b70 100755
--- a/lib/dpkg/t/t-trigdeferred.t
+++ b/lib/dpkg/t/t-trigdeferred.t
@@ -18,7 +18,7 @@
 use v5.36;
 use version;
 
-use Test::More;
+use Test::More tests => 21;
 use Cwd;
 use File::Path qw(make_path remove_tree);
 use File::Basename;
@@ -80,8 +80,6 @@ TEXT
     }
 );
 
-plan tests => scalar(@deferred) * 3;
-
 # Set a known umask.
 umask 0022;
 
diff --git a/scripts/t/Dpkg_Version.t b/scripts/t/Dpkg_Version.t
index 02bd0b485..49c42d027 100644
--- a/scripts/t/Dpkg_Version.t
+++ b/scripts/t/Dpkg_Version.t
@@ -15,7 +15,7 @@
 
 use v5.36;
 
-use Test::More;
+use Test::More tests => 1747;
 
 use IPC::Cmd qw(can_run);
 
@@ -34,8 +34,6 @@ my @ops = qw(
     > >> gt
 );
 
-plan tests => scalar(@tests) * (3 * scalar(@ops) + 4) + 27;
-
 my $have_dpkg = can_run('dpkg');
 
 sub dpkg_vercmp {
diff --git a/utils/t/update_alternatives.t b/utils/t/update_alternatives.t
index aba724697..0d927878d 100644
--- a/utils/t/update_alternatives.t
+++ b/utils/t/update_alternatives.t
@@ -15,7 +15,7 @@
 
 use v5.36;
 
-use Test::More;
+use Test::More tests => 712;
 
 use File::Spec;
 
@@ -102,10 +102,6 @@ my @choices = (
         slaves => [],
     },
 );
-my $nb_slaves = 4;
-plan tests => (4 * ($nb_slaves + 1) + 2) * 26 # number of check_choices
-               + 30                           # number of directory checks
-               + 110;                         # rest
 
 sub cleanup {
     system("rm -rf $tmpdir && mkdir -p $admindir && mkdir -p $altdir");
@@ -274,7 +270,7 @@ sub check_slaves {
        }
     }
 }
-# (4 * (nb_slaves+1) + 2) tests in each check_choice() call
+
 sub check_choice {
     my ($id, $mode, $msg) = @_;
     my $output;

-- 
Dpkg.Org's dpkg

Reply via email to