Skip to content

Commit 81bfe54

Browse files
committed
Merge branch 'dl/test-must-fail-fixes-4'
Test clean-up. * dl/test-must-fail-fixes-4: t9819: don't use test_must_fail with p4 t9164: use test_must_fail only on git commands t9160: use test_path_is_missing() t9141: use test_path_is_missing() t7508: don't use `test_must_fail test_cmp` t7408: replace incorrect uses of test_must_fail t6030: use test_path_is_missing()
2 parents 5fd02fc + 546f352 commit 81bfe54

7 files changed

+18
-18
lines changed

t/t6030-bisect-porcelain.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ test_expect_success 'bisect start: no ".git/BISECT_START" created if junk rev' '
148148
test_must_fail git bisect start $HASH4 foo -- &&
149149
git branch > branch.output &&
150150
grep "* other" branch.output > /dev/null &&
151-
test_must_fail test -e .git/BISECT_START
151+
test_path_is_missing .git/BISECT_START
152152
'
153153

154154
test_expect_success 'bisect start: existing ".git/BISECT_START" not modified if junk rev' '
@@ -166,7 +166,7 @@ test_expect_success 'bisect start: no ".git/BISECT_START" if mistaken rev' '
166166
test_must_fail git bisect start $HASH1 $HASH4 -- &&
167167
git branch > branch.output &&
168168
grep "* other" branch.output > /dev/null &&
169-
test_must_fail test -e .git/BISECT_START
169+
test_path_is_missing .git/BISECT_START
170170
'
171171

172172
test_expect_success 'bisect start: no ".git/BISECT_START" if checkout error' '
@@ -175,7 +175,7 @@ test_expect_success 'bisect start: no ".git/BISECT_START" if checkout error' '
175175
git branch &&
176176
git branch > branch.output &&
177177
grep "* other" branch.output > /dev/null &&
178-
test_must_fail test -e .git/BISECT_START &&
178+
test_path_is_missing .git/BISECT_START &&
179179
test -z "$(git for-each-ref "refs/bisect/*")" &&
180180
git checkout HEAD hello
181181
'
@@ -485,7 +485,7 @@ test_expect_success 'optimized merge base checks' '
485485
git bisect bad &&
486486
git bisect good "$A_HASH" > my_bisect_log4.txt &&
487487
test_i18ngrep "merge base must be tested" my_bisect_log4.txt &&
488-
test_must_fail test -f ".git/BISECT_ANCESTORS_OK"
488+
test_path_is_missing ".git/BISECT_ANCESTORS_OK"
489489
'
490490

491491
# This creates another side branch called "parallel" with some files

t/t7408-submodule-reference.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ test_expect_success 'missing submodule alternate fails clone and submodule updat
122122
# update of the submodule succeeds
123123
test_must_fail git submodule update --init &&
124124
# and we have no alternates:
125-
test_must_fail test_alternate_is_used .git/modules/sub/objects/info/alternates sub &&
126-
test_must_fail test_path_is_file sub/file1
125+
test_path_is_missing .git/modules/sub/objects/info/alternates &&
126+
test_path_is_missing sub/file1
127127
)
128128
'
129129

@@ -137,7 +137,7 @@ test_expect_success 'ignoring missing submodule alternates passes clone and subm
137137
# update of the submodule succeeds
138138
git submodule update --init &&
139139
# and we have no alternates:
140-
test_must_fail test_alternate_is_used .git/modules/sub/objects/info/alternates sub &&
140+
test_path_is_missing .git/modules/sub/objects/info/alternates &&
141141
test_path_is_file sub/file1
142142
)
143143
'
@@ -182,7 +182,7 @@ check_that_two_of_three_alternates_are_used() {
182182
# immediate submodule has alternate:
183183
test_alternate_is_used .git/modules/subwithsub/objects/info/alternates subwithsub &&
184184
# but nested submodule has no alternate:
185-
test_must_fail test_alternate_is_used .git/modules/subwithsub/modules/sub/objects/info/alternates subwithsub/sub
185+
test_path_is_missing .git/modules/subwithsub/modules/sub/objects/info/alternates
186186
}
187187

188188

t/t7508-status.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,7 @@ test_expect_success '"status.branch=true" same as "-b"' '
14711471
test_expect_success '"status.branch=true" different from "--no-branch"' '
14721472
git status -s --no-branch >expected_nobranch &&
14731473
git -c status.branch=true status -s >actual &&
1474-
test_must_fail test_cmp expected_nobranch actual
1474+
! test_cmp expected_nobranch actual
14751475
'
14761476

14771477
test_expect_success '"status.branch=true" weaker than "--no-branch"' '

t/t9141-git-svn-multiple-branches.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ test_expect_success 'Multiple branch or tag paths require -d' '
9090
) &&
9191
( cd svn_project &&
9292
svn_cmd up &&
93-
test_must_fail test -d b_one/Nope &&
94-
test_must_fail test -d b_two/Nope &&
95-
test_must_fail test -d tags_A/Tagless &&
96-
test_must_fail test -d tags_B/Tagless
93+
test_path_is_missing b_one/Nope &&
94+
test_path_is_missing b_two/Nope &&
95+
test_path_is_missing tags_A/Tagless &&
96+
test_path_is_missing tags_B/Tagless
9797
)
9898
'
9999

t/t9160-git-svn-preserve-empty-dirs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ test_expect_success 'remove non-last entry from directory' '
8686
cd "$GIT_REPO" &&
8787
git checkout HEAD~2
8888
) &&
89-
test_must_fail test -f "$GIT_REPO"/2/.gitignore &&
90-
test_must_fail test -f "$GIT_REPO"/3/.gitignore
89+
test_path_is_missing "$GIT_REPO"/2/.gitignore &&
90+
test_path_is_missing "$GIT_REPO"/3/.gitignore
9191
'
9292

9393
# After re-cloning the repository with --placeholder-file specified, there

t/t9164-git-svn-dcommit-concurrent.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ test_expect_success 'check if post-commit hook creates a concurrent commit' '
9292
echo 1 >> file &&
9393
svn_cmd commit -m "changing file" &&
9494
svn_cmd up &&
95-
test_must_fail test_cmp auto_updated_file au_file_saved
95+
! test_cmp auto_updated_file au_file_saved
9696
)
9797
'
9898

@@ -103,7 +103,7 @@ test_expect_success 'check if pre-commit hook fails' '
103103
echo 2 >> file &&
104104
svn_cmd commit -m "changing file once again" &&
105105
echo 3 >> file &&
106-
test_must_fail svn_cmd commit -m "this commit should fail" &&
106+
! svn_cmd commit -m "this commit should fail" &&
107107
svn_cmd revert file
108108
)
109109
'

t/t9819-git-p4-case-folding.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ test_expect_success 'Check p4 is in case-folding mode' '
3030
cd "$cli" &&
3131
>lc/FILE.TXT &&
3232
p4 add lc/FILE.TXT &&
33-
test_must_fail p4 submit -d "Cannot add file differing only in case" lc/FILE.TXT
33+
! p4 submit -d "Cannot add file differing only in case" lc/FILE.TXT
3434
)
3535
'
3636

0 commit comments

Comments
 (0)