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

[PATCH v2 02/10] t3010: modernize style

From
Johannes Sixt <j6t@kdbg.org>
Date
Jun 7, 2013, 20:53 UTC
Message-ID
<8d271c08f2d49aca17e7bec6d841ac72af7b15b1.1370636706.git.j6t@kdbg.org>
In-Reply-To
<cover.1370076477.git.j6t@kdbg.org>
In particular:
- move test preparations inside test_expect_success
- place test description on the test_expect_success line
- indent with a tab
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t3010-ls-files-killed-modified.sh | 123 ++++++++++++++++++------------------
 1 file changed, 61 insertions(+), 62 deletions(-)
diff --git a/t/t3010-ls-files-killed-modified.sh b/t/t3010-ls-files-killed-modified.sh
index 95671c2..2d0ff2d 100755
--- a/t/t3010-ls-files-killed-modified.sh
+++ b/t/t3010-ls-files-killed-modified.sh
@@ -37,71 +37,70 @@ modified without reporting path9 and path10.
 '
 . ./test-lib.sh
 
-date >path0
-if test_have_prereq SYMLINKS
-then
-	ln -s xyzzy path1
-else
-	date > path1
-fi
-mkdir path2 path3
-date >path2/file2
-date >path3/file3
-: >path7
-date >path8
-: >path9
-date >path10
-test_expect_success \
-    'git update-index --add to add various paths.' \
-    "git update-index --add -- path0 path1 path?/file? path7 path8 path9 path10"
-
-rm -fr path? ;# leave path10 alone
-date >path2
-if test_have_prereq SYMLINKS
-then
-	ln -s frotz path3
-	ln -s nitfol path5
-else
-	date > path3
-	date > path5
-fi
-mkdir path0 path1 path6
-date >path0/file0
-date >path1/file1
-date >path6/file6
-date >path7
-: >path8
-: >path9
-touch path10
+test_expect_success 'git update-index --add to add various paths.' '
+	date >path0 &&
+	if test_have_prereq SYMLINKS
+	then
+		ln -s xyzzy path1
+	else
+		date > path1
+	fi &&
+	mkdir path2 path3 &&
+	date >path2/file2 &&
+	date >path3/file3 &&
+	: >path7 &&
+	date >path8 &&
+	: >path9 &&
+	date >path10 &&
+	git update-index --add -- path0 path1 path?/file? path7 path8 path9 path10 &&
+	rm -fr path?	# leave path10 alone
+'
 
-test_expect_success \
-    'git ls-files -k to show killed files.' \
-    'git ls-files -k >.output'
-cat >.expected <<EOF
-path0/file0
-path1/file1
-path2
-path3
-EOF
+test_expect_success 'git ls-files -k to show killed files.' '
+	date >path2 &&
+	if test_have_prereq SYMLINKS
+	then
+		ln -s frotz path3 &&
+		ln -s nitfol path5
+	else
+		date >path3 &&
+		date >path5
+	fi &&
+	mkdir path0 path1 path6 &&
+	date >path0/file0 &&
+	date >path1/file1 &&
+	date >path6/file6 &&
+	date >path7 &&
+	: >path8 &&
+	: >path9 &&
+	touch path10 &&
+	git ls-files -k >.output
+'
 
-test_expect_success \
-    'validate git ls-files -k output.' \
-    'test_cmp .expected .output'
+test_expect_success 'validate git ls-files -k output.' '
+	cat >.expected <<-\EOF &&
+	path0/file0
+	path1/file1
+	path2
+	path3
+	EOF
+	test_cmp .expected .output
+'
 
-test_expect_success \
-    'git ls-files -m to show modified files.' \
-    'git ls-files -m >.output'
-cat >.expected <<EOF
-path0
-path1
-path2/file2
-path3/file3
-path7
-path8
-EOF
+test_expect_success 'git ls-files -m to show modified files.' '
+	git ls-files -m >.output
+'
 
-test_expect_success \
-    'validate git ls-files -m output.' \
-    'test_cmp .expected .output'
+test_expect_success 'validate git ls-files -m output.' '
+	cat >.expected <<-\EOF &&
+	path0
+	path1
+	path2/file2
+	path3/file3
+	path7
+	path8
+	EOF
+	test_cmp .expected .output
+'
 
 test_done
-- 
1.8.3.rc1.32.g8b61cbb
Previous: Erik Faye-LundNext: Johannes Sixt
Message 27 of 35 in “Increase test coverage on Windows by removing SYMLINKS from many tests”
  1. 00/11 Increase test coverage on Windows by removing SYMLINKS from many testsJohannes Sixt, Jun 1, 2013
  2. 01/11 test-chmtime: Fix exit code on WindowsJohannes Sixt, Jun 1, 2013
  3. 02/11 t2100: modernize style and unroll a loop of test casesJohannes Sixt, Jun 1, 2013
  4. 03/11 t3010: modernize styleJohannes Sixt, Jun 1, 2013
  5. 04/11 tests: introduce test_ln_s and test_ln_s_addJohannes Sixt, Jun 1, 2013
  6. Ramkumar RamachandraJun 1, 2013
  7. Johannes SixtJun 1, 2013
  8. Ramkumar RamachandraJun 1, 2013
  9. 05/11 tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)Johannes Sixt, Jun 1, 2013
  10. Junio C HamanoJun 4, 2013
  11. Johannes SixtJun 5, 2013
  12. Junio C HamanoJun 4, 2013
  13. Johannes SixtJun 5, 2013
  14. 06/11 t0000: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 1, 2013
  15. 07/11 t2100: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 1, 2013
  16. Junio C HamanoJun 4, 2013
  17. Johannes SixtJun 5, 2013
  18. 08/11 t3030: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 1, 2013
  19. 09/11 t3100: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 1, 2013
  20. 10/11 t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 1, 2013
  21. Junio C HamanoJun 2, 2013
  22. 11/11 t6035: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 1, 2013
  23. 00/10 Increase test coverage on Windows by removing SYMLINKS from many testsJohannes Sixt, Jun 7, 2013
  24. Junio C HamanoJun 7, 2013
  25. 01/10 test-chmtime: Fix exit code on WindowsJohannes Sixt, Jun 7, 2013
  26. Erik Faye-LundNov 20, 2013
  27. 02/10 t3010: modernize styleJohannes Sixt, Jun 7, 2013
  28. 03/10 tests: introduce test_ln_s_addJohannes Sixt, Jun 7, 2013
  29. 04/10 tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)Johannes Sixt, Jun 7, 2013
  30. 05/10 t0000: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 7, 2013
  31. 06/10 t3030: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 7, 2013
  32. 07/10 t3100: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 7, 2013
  33. 08/10 t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 7, 2013
  34. 09/10 t6035: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 7, 2013
  35. 10/10 t4011: remove SYMLINKS prerequisiteJohannes Sixt, Jun 7, 2013

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.