summaryrefslogtreecommitdiff
path: root/t/t5521-pull-options.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-06-09 18:29:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-06-09 23:45:14 (GMT)
commitca8d148daf3014577222c2562ca2c8170a866aa4 (patch)
treed3225e86102154d591d8b25336eb4166c32efd0a /t/t5521-pull-options.sh
parentb1d04bfcf84cc3464d0bdf62b02443d0d55e3f2b (diff)
downloadgit-ca8d148daf3014577222c2562ca2c8170a866aa4.zip
git-ca8d148daf3014577222c2562ca2c8170a866aa4.tar.gz
git-ca8d148daf3014577222c2562ca2c8170a866aa4.tar.bz2
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/t5521-pull-options.sh')
-rwxr-xr-xt/t5521-pull-options.sh26
1 files changed, 13 insertions, 13 deletions
diff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh
index aa31abe..453aba5 100755
--- a/t/t5521-pull-options.sh
+++ b/t/t5521-pull-options.sh
@@ -15,19 +15,19 @@ test_expect_success 'git pull -q' '
mkdir clonedq &&
(cd clonedq && git init &&
git pull -q "../parent" >out 2>err &&
- test ! -s err &&
- test ! -s out)
+ test_must_be_empty err &&
+ test_must_be_empty out)
'
test_expect_success 'git pull -q --rebase' '
mkdir clonedqrb &&
(cd clonedqrb && git init &&
git pull -q --rebase "../parent" >out 2>err &&
- test ! -s err &&
- test ! -s out &&
+ test_must_be_empty err &&
+ test_must_be_empty out &&
git pull -q --rebase "../parent" >out 2>err &&
- test ! -s err &&
- test ! -s out)
+ test_must_be_empty err &&
+ test_must_be_empty out)
'
test_expect_success 'git pull' '
@@ -35,7 +35,7 @@ test_expect_success 'git pull' '
(cd cloned && git init &&
git pull "../parent" >out 2>err &&
test -s err &&
- test ! -s out)
+ test_must_be_empty out)
'
test_expect_success 'git pull --rebase' '
@@ -43,7 +43,7 @@ test_expect_success 'git pull --rebase' '
(cd clonedrb && git init &&
git pull --rebase "../parent" >out 2>err &&
test -s err &&
- test ! -s out)
+ test_must_be_empty out)
'
test_expect_success 'git pull -v' '
@@ -51,7 +51,7 @@ test_expect_success 'git pull -v' '
(cd clonedv && git init &&
git pull -v "../parent" >out 2>err &&
test -s err &&
- test ! -s out)
+ test_must_be_empty out)
'
test_expect_success 'git pull -v --rebase' '
@@ -59,22 +59,22 @@ test_expect_success 'git pull -v --rebase' '
(cd clonedvrb && git init &&
git pull -v --rebase "../parent" >out 2>err &&
test -s err &&
- test ! -s out)
+ test_must_be_empty out)
'
test_expect_success 'git pull -v -q' '
mkdir clonedvq &&
(cd clonedvq && git init &&
git pull -v -q "../parent" >out 2>err &&
- test ! -s out &&
- test ! -s err)
+ test_must_be_empty out &&
+ test_must_be_empty err)
'
test_expect_success 'git pull -q -v' '
mkdir clonedqv &&
(cd clonedqv && git init &&
git pull -q -v "../parent" >out 2>err &&
- test ! -s out &&
+ test_must_be_empty out &&
test -s err)
'