Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] t0000: modernise style

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:11

Stefano Lattarini [off-list ref] writes:
Match the style to more modern test scripts, namely:

 - Prefer tabs for indentation.

 - The first line of each test has prereq, title and opening sq for the
   script body.

 - Move cleanup or initialization of data used by a test inside the test
   itself.

 - Put a newline before the closing sq for each test.

 - Don't conclude the test descriptions with a full stop.

 - Prefer 'test_line_count FILE COUNT' over 'test $(wc -l <FILE) = COUNT'

 - Use '<<-EOF' style for here documented, so that they can be indented
s/documented,/document,/;
   as well.  Bot don't do that in case the resulting lines would be too
   long.

 - Don't redirect the output of commands to /dev/null unconditionally,
   the git testing framework should already take care of handling test
   verbosity transparently and uniformly.

Signed-off-by: Stefano Lattarini <redacted>
---

 Not sure whether a cosmetic-only patch like this coming from an
 "outsider" will be well-received or regarded as noise, but I guess
 the best way to find out is to try and send it.
A pair of good rule of thumb:

 (1) who the sender is does not matter.

 (2) an area that saw high activity recently tends to repel cosmetic-only
     patches.
quoted hunk
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index f4e8f43..fa2c5f4 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -34,69 +34,69 @@ fi
 # git init has been done in an empty repository.
 # make sure it is empty.
 
-find .git/objects -type f -print >should-be-empty
-test_expect_success \
-    '.git/objects should be empty after git init in an empty repo.' \
-    'cmp -s /dev/null should-be-empty'
+test_expect_success '.git/objects should be empty after git init in an empty repo' '
+	find .git/objects -type f -print >should-be-empty &&
+	cmp -s /dev/null should-be-empty
It might be even better to do this

	>empty
        test_cmp empty should-be-empty

when there is a behaviour change under "-v" option?

Or be consistent with the next one and use test_line_count for zero?

I'll backburner the remainder of the patch.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help