summaryrefslogtreecommitdiff
path: root/t/t9402-git-cvsserver-refs.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/t9402-git-cvsserver-refs.sh
parentb1d04bfcf84cc3464d0bdf62b02443d0d55e3f2b (diff)
downloadgit-ca8d148daf3014577222c2562ca2c8170a866aa4.tar.gz
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/t9402-git-cvsserver-refs.sh')
-rwxr-xr-xt/t9402-git-cvsserver-refs.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh
index 735a018ecc..db69af2cff 100755
--- a/t/t9402-git-cvsserver-refs.sh
+++ b/t/t9402-git-cvsserver-refs.sh
@@ -330,7 +330,7 @@ test_expect_success 'validate result of edits [cvswork2]' '
test_expect_success 'validate basic diffs saved during above cvswork2 edits' '
test $(grep Index: cvsEdit1.diff | wc -l) = 1 &&
- test ! -s cvsEdit2-empty.diff &&
+ test_must_be_empty cvsEdit2-empty.diff &&
test $(grep Index: cvsEdit2-N.diff | wc -l) = 1 &&
test $(grep Index: cvsEdit3.diff | wc -l) = 3 &&
rm -rf diffSandbox &&
@@ -456,20 +456,20 @@ test_expect_success 'cvs up -r $(git rev-parse v1)' '
test_expect_success 'cvs diff -r v1 -u' '
( cd cvswork && cvs -f diff -r v1 -u ) >cvsDiff.out 2>cvs.log &&
- test ! -s cvsDiff.out &&
- test ! -s cvs.log
+ test_must_be_empty cvsDiff.out &&
+ test_must_be_empty cvs.log
'
test_expect_success 'cvs diff -N -r v2 -u' '
( cd cvswork && ! cvs -f diff -N -r v2 -u ) >cvsDiff.out 2>cvs.log &&
- test ! -s cvs.log &&
+ test_must_be_empty cvs.log &&
test -s cvsDiff.out &&
check_diff cvsDiff.out v2 v1 >check_diff.out 2>&1
'
test_expect_success 'cvs diff -N -r v2 -r v1.2' '
( cd cvswork && ! cvs -f diff -N -r v2 -r v1.2 -u ) >cvsDiff.out 2>cvs.log &&
- test ! -s cvs.log &&
+ test_must_be_empty cvs.log &&
test -s cvsDiff.out &&
check_diff cvsDiff.out v2 v1.2 >check_diff.out 2>&1
'
@@ -488,7 +488,7 @@ test_expect_success 'apply early [cvswork3] diff to b3' '
test_expect_success 'check [cvswork3] diff' '
( cd cvswork3 && ! cvs -f diff -N -u ) >"$WORKDIR/cvsDiff.out" 2>cvs.log &&
- test ! -s cvs.log &&
+ test_must_be_empty cvs.log &&
test -s cvsDiff.out &&
test $(grep Index: cvsDiff.out | wc -l) = 3 &&
test_cmp cvsDiff.out cvswork3edit.diff &&