git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v1] test-lib: move comment about test_description
@ 2023-02-21 23:22 Andrei Rybak
  2023-02-25 19:05 ` [RFC PATCH v2] test-lib: drop " Andrei Rybak
  0 siblings, 1 reply; 4+ messages in thread
From: Andrei Rybak @ 2023-02-21 23:22 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

When a comment describing how each test file should start was added in
commit [1], it was the second comment of t/test-lib.sh.  The comment
describes how variable "test_description" is supposed to be assigned at
the top of each test file.  However, even in [1], the comment was ten
lines away from the usage of the variable by test-lib.sh.  Since then,
the comment has drifted away both from the top of the file and from the
usage of the variable.  The comment just sits in the middle of the
initialization of the test library, surrounded by unrelated code.

Move the comment describing how variable "test_description" is supposed
to be assigned to just above the usage of the variable in test-lib.sh.

An alternative is to just drop this comment, since assignment of
"test_description" and the process of writing tests in general are
described in detail in "t/README".

[1] e1970ce43a ("[PATCH 1/2] Test framework take two.", 2005-05-13)

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
---
 t/test-lib.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index d272cca008..c21934251d 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -645,12 +645,6 @@ u200c=$(printf '\342\200\214')
 
 export _x05 _x35 LF u200c EMPTY_TREE EMPTY_BLOB ZERO_OID OID_REGEX
 
-# Each test should start with something like this, after copyright notices:
-#
-# test_description='Description of this test...
-# This test checks if command xyzzy does the right thing...
-# '
-# . ./test-lib.sh
 test "x$TERM" != "xdumb" && (
 		test -t 1 &&
 		tput bold >/dev/null 2>&1 &&
@@ -746,6 +740,12 @@ then
 	fi
 fi
 
+# Each test should start with something like this, after copyright notices:
+#
+# test_description='Description of this test...
+# This test checks if command xyzzy does the right thing...
+# '
+# . ./test-lib.sh
 test "${test_description}" != "" ||
 error "Test script did not set test_description."
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-26 10:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-21 23:22 [RFC PATCH v1] test-lib: move comment about test_description Andrei Rybak
2023-02-25 19:05 ` [RFC PATCH v2] test-lib: drop " Andrei Rybak
2023-02-25 22:50   ` Junio C Hamano
2023-02-26 10:53   ` [PATCH v3] " Andrei Rybak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).