commit:     6ee0913b255b36c6fef503564bb26b56ee4c3268
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sat Aug 10 05:59:00 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Aug 11 10:11:04 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=6ee0913b

test-functions: don't increment testnum by 2 for test_ebegin()

Also, restore the correct test_description string, which was being lost
in a subshell.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 test-functions | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/test-functions b/test-functions
index 28c72da..81593b8 100755
--- a/test-functions
+++ b/test-functions
@@ -109,14 +109,16 @@ test_die() {
 test_ebegin() {
        set -- eq 0
 
-       callback() (
+       callback() {
                test_description="ebegin message (expecting terminating 
newline)"
-               _eprint() {
-                       shift
-                       _ends_with_newline "$*"
-               }
-               ebegin "message"
-       )
+               (
+                       _eprint() {
+                               shift
+                               _ends_with_newline "$*"
+                       }
+                       ebegin "message"
+               )
+       }
 
        iterate_tests 2 "$@"
 }
@@ -1200,7 +1202,7 @@ elif ! GENFUN_MODULES="portage rc" . ./functions.sh; then
 else
        assign_tmpdir
        test_chdir || rc=1
-       test_ebegin || rc=1; testnum=$((testnum + 1))
+       test_ebegin || rc=1
        test_is_older_than || rc=1
        test_get_bootparam || rc=1
        test_esyslog || rc=1

Reply via email to