]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Fix --extract-tests-module with a test module.
authorCollin Funk <collin.funk1@gmail.com>
Mon, 1 Apr 2024 08:18:17 +0000 (01:18 -0700)
committerBruno Haible <bruno@clisp.org>
Mon, 1 Apr 2024 13:13:15 +0000 (15:13 +0200)
* pygnulib/GLModuleSystem.py (GLModule.getTestsName): Return the module
name with '-tests' appended to it unconditionally.

ChangeLog
pygnulib/GLModuleSystem.py

index 441bbb4ceb6d7a31f7a224c6b6549070bf530f81..0fcb7bedc7410953a5d05ab30caac05738127eeb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-04-01  Collin Funk  <collin.funk1@gmail.com>
+
+       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-04-01  Collin Funk  <collin.funk1@gmail.com>
 
        gnulib-tool.py: Use case-sensitive sorting for file names.
index 0d791fb6648bff8920c2f43aecfc40ba44bb615c..ba92d8a9338e3683a9e6007abdaae361fee4c17d 100644 (file)
@@ -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.'''