git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 3/4] t5704: match tests to modern style

From
Thomas Rast <trast@student.ethz.ch>
Date
Feb 23, 2012, 09:42 UTC
Message-ID
<c6579adc648119fbd1c54e2a1a9a0de86e0e8b57.1329988335.git.trast@student.ethz.ch>
In-Reply-To
<cover.1329988335.git.trast@student.ethz.ch>
The test did not adhere to the current style on several counts:
- empty lines around the test blocks, but within the test string
- ': > file' or even just '> file' with an extra space
- inconsistent indentation
- hand-rolled commits instead of using test_commit

Fix all of them. There's a catch to the last point: test_commit creates a tag. We still change it to test_commit, and explicitly delete the tags, so as to highlight that the test relies on not having them.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 t/t5704-bundle.sh |   33 ++++++++-------------------------
 1 file changed, 8 insertions(+), 25 deletions(-)
diff --git a/t/t5704-bundle.sh b/t/t5704-bundle.sh
index 4ae127d..f35f559 100755
--- a/t/t5704-bundle.sh
+++ b/t/t5704-bundle.sh
@@ -4,59 +4,42 @@ test_description='some bundle related tests'
 . ./test-lib.sh
 
 test_expect_success 'setup' '
-
-	: > file &&
-	git add file &&
-	test_tick &&
-	git commit -m initial &&
+	test_commit initial &&
 	test_tick &&
 	git tag -m tag tag &&
-	: > file2 &&
-	git add file2 &&
-	: > file3 &&
-	test_tick &&
-	git commit -m second &&
-	git add file3 &&
-	test_tick &&
-	git commit -m third
-
+	test_commit second &&
+	test_commit third &&
+	git tag -d initial &&
+	git tag -d second &&
+	git tag -d third
 '
 
 test_expect_success 'tags can be excluded by rev-list options' '
-
 	git bundle create bundle --all --since=7.Apr.2005.15:16:00.-0700 &&
 	git ls-remote bundle > output &&
 	! grep tag output
-
 '
 
 test_expect_success 'die if bundle file cannot be created' '
-
 	mkdir adir &&
 	test_must_fail git bundle create adir --all
-
 '
 
 test_expect_failure 'bundle --stdin' '
-
 	echo master | git bundle create stdin-bundle.bdl --stdin &&
 	git ls-remote stdin-bundle.bdl >output &&
 	grep master output
-
 '
 
 test_expect_failure 'bundle --stdin <rev-list options>' '
-
 	echo master | git bundle create hybrid-bundle.bdl --stdin tag &&
 	git ls-remote hybrid-bundle.bdl >output &&
 	grep master output
-
 '
 
 test_expect_success 'empty bundle file is rejected' '
-
-    >empty-bundle && test_must_fail git fetch empty-bundle
-
+	: >empty-bundle &&
+	test_must_fail git fetch empty-bundle
 '
 
 test_done
-- 
1.7.9.1.430.g4998543
Previous: Thomas RastNext: Junio C Hamano
Message 5 of 8 in “Making an elephant out of a getline() bug”
  1. 0/4 Making an elephant out of a getline() bugThomas Rast, Feb 23, 2012
  2. 1/4 strbuf: improve strbuf_get*line documentationThomas Rast, Feb 23, 2012
  3. Jeff KingFeb 23, 2012
  4. 2/4 bundle: put strbuf_readline_fd in strbuf.c with adjustmentsThomas Rast, Feb 23, 2012
  5. 3/4 t5704: match tests to modern styleThomas Rast, Feb 23, 2012
  6. Junio C HamanoFeb 23, 2012
  7. 4/4 bundle: use a strbuf to scan the log for boundary commitsThomas Rast, Feb 23, 2012
  8. Junio C HamanoFeb 23, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.