From e60b3061664938559ae7ef561d3b11f87130c21a Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Mon, 1 Apr 2024 01:18:17 -0700 Subject: [PATCH 1/2] gnulib-tool.py: Fix --extract-tests-module with a test module. * pygnulib/GLModuleSystem.py (GLModule.getTestsName): Return the module name with '-tests' appended to it unconditionally. --- ChangeLog | 6 ++++++ pygnulib/GLModuleSystem.py | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5381e276c6..056f8827dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-04-01 Collin Funk + + gnulib-tool.py: Fix --extract-tests-module with a test module. + * pygnulib/GLModuleSystem.py (GLModule.getTestsName): Return the module + name with '-tests' appended to it unconditionally. + 2024-03-31 Collin Funk gnulib-tool.py: Use case-sensitive sorting for files. diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py index 0d791fb664..ba92d8a933 100644 --- a/pygnulib/GLModuleSystem.py +++ b/pygnulib/GLModuleSystem.py @@ -308,10 +308,7 @@ class GLModule(object): def getTestsName(self) -> str: '''Return -tests version of the module name.''' - result = self.getName() - if not result.endswith('-tests'): - result += '-tests' - return result + return f'{self.name}-tests' def getTestsModule(self) -> GLModule | None: '''Return -tests version of the module as GLModule.''' -- 2.44.0