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

[PATCH 3/7] modernize t9300: use test_must_be_empty

From
Johannes Sixt <j6t@kdbg.org>
Date
Nov 19, 2015, 19:09 UTC
Message-ID
<52bae1a41e445d308cbfea21dfd696bc16df3cbf.1447959452.git.j6t@kdbg.org>
In-Reply-To
<cover.1447959452.git.j6t@kdbg.org>

Instead of comparing actual output to an empty file, use test_must_be_empty. In addition to the better error message provided by the helper, allocation of an empty file during the setup sequence can be avoided.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t9300-fast-import.sh | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index e9c7602..ceb3db3 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -47,8 +47,6 @@ file5_data='an inline file.
 file6_data='#!/bin/sh
 echo "$@"'
 
->empty
-
 ###
 ### series A
 ###
@@ -2320,12 +2318,12 @@ test_expect_success !MINGW 'R: in-stream cat-blob-fd not respected' '
 	cat-blob $blob
 	EOF
 	test_cmp expect actual.3 &&
-	test_cmp empty actual.1 &&
+	test_must_be_empty actual.1 &&
 	git fast-import 3>actual.3 >actual.1 <<-EOF &&
 	option cat-blob-fd=3
 	cat-blob $blob
 	EOF
-	test_cmp empty actual.3 &&
+	test_must_be_empty actual.3 &&
 	test_cmp expect actual.1
 '
 
@@ -2549,7 +2547,7 @@ EOF
 
 test_expect_success 'R: quiet option results in no stats being output' '
 	cat input | git fast-import 2> output &&
-	test_cmp empty output
+	test_must_be_empty output
 '
 
 test_expect_success 'R: feature done means terminating "done" is mandatory' '
-- 
2.6.2.337.ga235d84
Previous: Johannes SixtNext: Johannes Sixt
Message 4 of 10 in “Modernize t9300-fast-import”
  1. 0/7 Modernize t9300-fast-importJohannes Sixt, Nov 19, 2015
  2. 1/7 modernize t9300: single-quote placement and indentationJohannes Sixt, Nov 19, 2015
  3. 2/7 modernize t9300: use test_must_failJohannes Sixt, Nov 19, 2015
  4. 3/7 modernize t9300: use test_must_be_emptyJohannes Sixt, Nov 19, 2015
  5. 4/7 modernize t9300: wrap lines after &&Johannes Sixt, Nov 19, 2015
  6. 5/7 modernize t9300: use test_when_finished for clean-upJohannes Sixt, Nov 19, 2015
  7. 6/7 modernize t9300: mark here-doc words to ignore tab indentationJohannes Sixt, Nov 19, 2015
  8. 7/7 modernize t9300: move test preparations into test_expect_successJohannes Sixt, Nov 19, 2015
  9. Eric SunshineNov 20, 2015
  10. Jeff KingNov 20, 2015

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.