tests: make use of the test_must_be_empty function
Change various tests that use an idiom of the form:
>expect &&
test_cmp expect actual
To instead use:
test_must_be_empty actual
The test_must_be_empty() wrapper was introduced in ca8d148daf
("test:
test_must_be_empty helper", 2013-06-09). Many of these tests have been
added after that time. This was mostly found with, and manually pruned
from:
git grep '^\s+>.*expect.* &&$' t
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
ffc6fa0e39
commit
d3c6751b18
@ -693,9 +693,8 @@ test_expect_success \
|
||||
'
|
||||
|
||||
test_expect_success 'The -n 100 invocation means -n --list 100, not -n100' '
|
||||
>expect &&
|
||||
git tag -n 100 >actual &&
|
||||
test_cmp expect actual &&
|
||||
test_must_be_empty actual &&
|
||||
|
||||
git tag -m "A msg" 100 &&
|
||||
echo "100 A msg" >expect &&
|
||||
@ -974,9 +973,8 @@ test_expect_success GPG 'verifying a proper tag with --format pass and format ac
|
||||
'
|
||||
|
||||
test_expect_success GPG 'verifying a forged tag with --format should fail silently' '
|
||||
>expect &&
|
||||
test_must_fail git tag -v --format="tagname : %(tag)" "forged-tag" >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
# blank and empty messages for signed tags:
|
||||
@ -1382,9 +1380,8 @@ test_expect_success 'message in editor has initial comment: first line' '
|
||||
test_expect_success \
|
||||
'message in editor has initial comment: remainder' '
|
||||
# remove commented lines from the remainder -- should be empty
|
||||
>rest.expect &&
|
||||
sed -e 1d -e "/^#/d" <actual >rest.actual &&
|
||||
test_cmp rest.expect rest.actual
|
||||
test_must_be_empty rest.actual
|
||||
'
|
||||
|
||||
get_tag_header reuse $commit commit $time >expect
|
||||
@ -1466,19 +1463,18 @@ test_expect_success 'checking that first commit is in all tags (relative)' "
|
||||
|
||||
# All the --contains tests above, but with --no-contains
|
||||
test_expect_success 'checking that first commit is not listed in any tag with --no-contains (hash)' "
|
||||
>expected &&
|
||||
git tag -l --no-contains $hash1 v* >actual &&
|
||||
test_cmp expected actual
|
||||
test_must_be_empty actual
|
||||
"
|
||||
|
||||
test_expect_success 'checking that first commit is in all tags (tag)' "
|
||||
git tag -l --no-contains v1.0 v* >actual &&
|
||||
test_cmp expected actual
|
||||
test_must_be_empty actual
|
||||
"
|
||||
|
||||
test_expect_success 'checking that first commit is in all tags (relative)' "
|
||||
git tag -l --no-contains HEAD~2 v* >actual &&
|
||||
test_cmp expected actual
|
||||
test_must_be_empty actual
|
||||
"
|
||||
|
||||
cat > expected <<EOF
|
||||
@ -1606,9 +1602,8 @@ test_expect_success 'checking that --contains can be used in non-list mode' '
|
||||
'
|
||||
|
||||
test_expect_success 'checking that initial commit is in all tags with --no-contains' "
|
||||
>expected &&
|
||||
git tag -l --no-contains $hash1 v* >actual &&
|
||||
test_cmp expected actual
|
||||
test_must_be_empty actual
|
||||
"
|
||||
|
||||
# mixing modes and options:
|
||||
@ -1905,7 +1900,6 @@ test_expect_success 'version sort with very long prerelease suffix' '
|
||||
'
|
||||
|
||||
test_expect_success ULIMIT_STACK_SIZE '--contains and --no-contains work in a deep repo' '
|
||||
>expect &&
|
||||
i=1 &&
|
||||
while test $i -lt 8000
|
||||
do
|
||||
@ -1920,7 +1914,7 @@ EOF"
|
||||
git checkout master &&
|
||||
git tag far-far-away HEAD^ &&
|
||||
run_with_limited_stack git tag --contains HEAD >actual &&
|
||||
test_cmp expect actual &&
|
||||
test_must_be_empty actual &&
|
||||
run_with_limited_stack git tag --no-contains HEAD >actual &&
|
||||
test_line_count "-gt" 10 actual
|
||||
'
|
||||
|
Reference in New Issue
Block a user