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

Re: What's cooking in git.git (Dec 2017, #01; Mon, 4)

From
Todd Zullinger <tmz@pobox.com>
Date
Dec 7, 2017, 21:33 UTC
Message-ID
<20171207213312.GB3693@zaya.teonanacatl.net>
In-Reply-To
<175f87bc-0270-fb18-fc14-24e8f59321d6@jeffhostetler.com>
Jeff Hostetler wrote:
> I'm looking at t5616 now on my mac.
> Looks like the MAC doesn't like my line counting in the tests.
> I'll fix in my next version.
Perhaps that's as simple as using the test_line_counts helper?
diff --git i/t/t5616-partial-clone.sh w/t/t5616-partial-clone.sh
index fa573f8cdb..6d673de90c 100755
--- i/t/t5616-partial-clone.sh
+++ w/t/t5616-partial-clone.sh
@@ -19,7 +19,7 @@ test_expect_success 'setup normal src repo' '
 		git -C src ls-files -s file.$n.txt >>temp
 	done &&
 	awk -f print_2.awk <temp | sort >expect_1.oids &&
-	test "$(wc -l <expect_1.oids)" = "4"
+	test_line_count = 4 expect_1.oids
 '
 
 # bare clone "src" giving "srv.bare" for use as our server.
@@ -76,7 +76,7 @@ test_expect_success 'push new commits to server' '
 	grep blob <temp \
 		| awk -f print_1.awk \
 		| sort >expect_2.oids &&
-	test "$(wc -l <expect_2.oids)" = "8" &&
+	test_line_count = 8 expect_2.oids &&
 	git -C src blame master -- file.1.txt >expect.blame
 '
 
@@ -100,7 +100,7 @@ test_expect_success 'partial fetch inherits filter settings' '
 # it should be in a new packfile (since the promisor boundary is
 # currently a packfile, it should not get unpacked upon receipt.)
 test_expect_success 'verify diff causes dynamic object fetch' '
-	test "$(wc -l <observed.oids)" = "4" &&
+	test_line_count = 4 observed.oids &&
 		cat observed.oids &&
 	git -C pc1 diff master..origin/master -- file.1.txt &&
 	(	cd pc1/.git/objects/pack;
@@ -110,7 +110,7 @@ test_expect_success 'verify diff causes dynamic object fetch' '
 		| awk -f print_1.awk \
 		| sort >observed.oids &&
 		cat observed.oids &&
-	test "$(wc -l <observed.oids)" = "4"
+	test_line_count = 4 observed.oids
 '
 
 # force dynamic object fetch using blame.
-- 
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If quizzes are quizzical, what are tests?
Previous: Torsten BögershausenNext: Torsten Bögershausen
Message 24 of 26 in “What's cooking in git.git (Dec 2017, #01; Mon, 4)”
  1. Junio C HamanoDec 4, 2017
  2. Jeff HostetlerDec 4, 2017
  3. Elijah NewrenDec 4, 2017
  4. Jonathan TanDec 4, 2017
  5. Junio C HamanoDec 5, 2017
  6. Lars SchneiderDec 6, 2017
  7. Torsten BögershausenDec 6, 2017
  8. Junio C HamanoDec 6, 2017
  9. Johannes SchindelinDec 7, 2017
  10. Todd ZullingerDec 7, 2017
  11. Junio C HamanoDec 7, 2017
  12. Lars SchneiderDec 7, 2017
  13. Junio C HamanoDec 7, 2017
  14. Jeff HostetlerDec 7, 2017
  15. Junio C HamanoDec 7, 2017
  16. 1/1 check-non-portable-shell.pl: Quoted `wc -l` is not portabletboegi@web.de, Dec 10, 2017
  17. Johannes SchindelinDec 10, 2017
  18. Junio C HamanoDec 11, 2017
  19. 1/1 check-non-portable-shell.pl: Quoted `wc -l` is not portabletboegi@web.de, Dec 16, 2017
  20. Eric SunshineDec 17, 2017
  21. 1/1 check-non-portable-shell.pl: Quoted `wc -l` is not portabletboegi@web.de, Dec 21, 2017
  22. Junio C HamanoDec 22, 2017
  23. Torsten BögershausenDec 23, 2017
  24. Todd ZullingerDec 7, 2017
  25. Torsten BögershausenDec 9, 2017
  26. Johannes SchindelinDec 10, 2017

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.