From f0dc593a95877298ba6fa9d29e5c779832ad5894 Mon Sep 17 00:00:00 2001 From: SZEDER Gábor Date: Sun, 19 Aug 2018 23:57:23 +0200 Subject: tests: use 'test_must_be_empty' instead of 'test ! -s' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using 'test_must_be_empty' is preferable to 'test ! -s', because it gives a helpful error message if the given file is unexpectedly no empty, while the latter remains completely silent. Furthermore, it also catches cases when the given file unexpectedly does not exist at all. This patch was created by: sed -i -e 's/test ! -s/test_must_be_empty/' t[0-9]*.sh Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- t/t8010-cat-file-filters.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/t8010-cat-file-filters.sh') diff --git a/t/t8010-cat-file-filters.sh b/t/t8010-cat-file-filters.sh index 0f86c19174..31de4b64dc 100755 --- a/t/t8010-cat-file-filters.sh +++ b/t/t8010-cat-file-filters.sh @@ -47,7 +47,7 @@ test_expect_success 'cat-file --textconv --path= works' ' test_expect_success '--path= complains without --textconv/--filters' ' sha1=$(git rev-parse -q --verify HEAD:world.txt) && test_must_fail git cat-file --path=hello.txt blob $sha1 >actual 2>err && - test ! -s actual && + test_must_be_empty actual && grep "path.*needs.*filters" err ' -- cgit v1.2.3