aboutsummaryrefslogtreecommitdiff
path: root/t/t7400-submodule-basic.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-06-09 11:29:20 -0700
committerJunio C Hamano <gitster@pobox.com>2013-06-09 16:45:14 -0700
commitca8d148daf3014577222c2562ca2c8170a866aa4 (patch)
treed3225e86102154d591d8b25336eb4166c32efd0a /t/t7400-submodule-basic.sh
parentb1d04bfcf84cc3464d0bdf62b02443d0d55e3f2b (diff)
downloadgit-ca8d148daf3014577222c2562ca2c8170a866aa4.tar.gz
git-ca8d148daf3014577222c2562ca2c8170a866aa4.tar.xz
test: test_must_be_empty helper
There are quite a lot places where an output file is expected to be empty, and we fail the test when it is not. The output from running the test script with -i -v can be helped if we showed the unexpected contents at that point. We could of course do >expected.empty && test_cmp expected.empty actual but this is commmon enough to be done with a dedicated helper. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7400-submodule-basic.sh')
-rwxr-xr-xt/t7400-submodule-basic.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 2683cba7e..0055da965 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -78,7 +78,7 @@ test_expect_success 'submodule add' '
(
cd addtest &&
git submodule add -q "$submodurl" submod >actual &&
- test ! -s actual &&
+ test_must_be_empty actual &&
echo "gitdir: ../.git/modules/submod" >expect &&
test_cmp expect submod/.git &&
(
@@ -308,7 +308,7 @@ test_expect_success 'update should work when path is an empty dir' '
mkdir init &&
git submodule update -q >update.out &&
- test ! -s update.out &&
+ test_must_be_empty update.out &&
inspect init &&
test_cmp expect head-sha1
@@ -696,7 +696,7 @@ test_expect_success 'submodule add --name allows to replace a submodule with ano
rm -rf repo &&
git rm repo &&
git submodule add -q --name repo_new "$submodurl/bare.git" repo >actual &&
- test ! -s actual &&
+ test_must_be_empty actual &&
echo "gitdir: ../.git/modules/submod" >expect &&
test_cmp expect submod/.git &&
(