Skip to content

Commit 5b0b971

Browse files
newrengitster
authored andcommitted
t6036, t6042: prefer test_path_is_file, test_path_is_missing
Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0cdabc1 commit 5b0b971

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

t/t6036-recursive-corner-cases.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ test_expect_success 'merge of D & E2 fails but has appropriate contents' '
488488
test $(git rev-parse :1:a/file) = $(git rev-parse C:a/file) &&
489489
test $(git rev-parse :0:ignore-me) = $(git rev-parse A:ignore-me) &&
490490
491-
test -f a~HEAD
491+
test_path_is_file a~HEAD
492492
)
493493
'
494494

@@ -512,7 +512,7 @@ test_expect_success 'merge of E2 & D fails but has appropriate contents' '
512512
test $(git rev-parse :1:a/file) = $(git rev-parse C:a/file) &&
513513
test $(git rev-parse :0:ignore-me) = $(git rev-parse A:ignore-me) &&
514514
515-
test -f a~D^0
515+
test_path_is_file a~D^0
516516
)
517517
'
518518

t/t6042-merge-rename-corner-cases.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test_expect_success "Does git preserve Gollum's precious artifact?" '
3838
test_must_fail git merge -s recursive rename-the-ring &&
3939
4040
# Make sure git did not delete an untracked file
41-
test -f ring
41+
test_path_is_file ring
4242
)
4343
'
4444

@@ -213,8 +213,8 @@ test_expect_failure 'detect rename/add-source and preserve all data' '
213213
git ls-files -o >out &&
214214
test_line_count = 1 out &&
215215
216-
test -f a &&
217-
test -f b &&
216+
test_path_is_file a &&
217+
test_path_is_file b &&
218218
219219
test $(git rev-parse HEAD:b) = $(git rev-parse A:a) &&
220220
test $(git rev-parse HEAD:a) = $(git rev-parse C:a)
@@ -236,8 +236,8 @@ test_expect_failure 'detect rename/add-source and preserve all data, merge other
236236
git ls-files -o >out &&
237237
test_line_count = 1 out &&
238238
239-
test -f a &&
240-
test -f b &&
239+
test_path_is_file a &&
240+
test_path_is_file b &&
241241
242242
test $(git rev-parse HEAD:b) = $(git rev-parse A:a) &&
243243
test $(git rev-parse HEAD:a) = $(git rev-parse C:a)
@@ -302,8 +302,8 @@ test_expect_success 'rename/directory conflict + clean content merge' '
302302
303303
test $(git rev-parse :2:newfile) = $(git hash-object expect) &&
304304
305-
test -f newfile/realfile &&
306-
test -f newfile~HEAD
305+
test_path_is_file newfile/realfile &&
306+
test_path_is_file newfile~HEAD
307307
)
308308
'
309309

@@ -340,8 +340,8 @@ test_expect_success 'rename/directory conflict + content merge conflict' '
340340
test $(git rev-parse :2:newfile) = $(git rev-parse left-conflict:newfile) &&
341341
test $(git rev-parse :3:newfile) = $(git rev-parse right:file) &&
342342
343-
test -f newfile/realfile &&
344-
test -f newfile~HEAD
343+
test_path_is_file newfile/realfile &&
344+
test_path_is_file newfile~HEAD
345345
)
346346
'
347347

@@ -394,7 +394,7 @@ test_expect_success 'disappearing dir in rename/directory conflict handled' '
394394
echo 7 >>expect &&
395395
test_cmp expect sub &&
396396
397-
test -f sub
397+
test_path_is_file sub
398398
)
399399
'
400400

@@ -453,10 +453,10 @@ test_expect_success 'handle rename/rename (2to1) conflict correctly' '
453453
git ls-files -o >out &&
454454
test_line_count = 3 out &&
455455
456-
test ! -f a &&
457-
test ! -f b &&
458-
test -f c~HEAD &&
459-
test -f c~C^0 &&
456+
test_path_is_missing a &&
457+
test_path_is_missing b &&
458+
test_path_is_file c~HEAD &&
459+
test_path_is_file c~C^0 &&
460460
461461
test $(git hash-object c~HEAD) = $(git rev-parse C:a) &&
462462
test $(git hash-object c~C^0) = $(git rev-parse B:b)
@@ -509,7 +509,7 @@ test_expect_success 'merge has correct working tree contents' '
509509
test $(git rev-parse :3:b) = $(git rev-parse A:a) &&
510510
test $(git rev-parse :2:c) = $(git rev-parse A:a) &&
511511
512-
test ! -f a &&
512+
test_path_is_missing a &&
513513
test $(git hash-object b) = $(git rev-parse A:a) &&
514514
test $(git hash-object c) = $(git rev-parse A:a)
515515
)
@@ -562,9 +562,9 @@ test_expect_failure 'detect conflict with rename/rename(1to2)/add-source merge'
562562
test $(git rev-parse 2:b) = $(git rev-parse B:b) &&
563563
test $(git rev-parse 3:c) = $(git rev-parse C:c) &&
564564
565-
test -f a &&
566-
test -f b &&
567-
test -f c
565+
test_path_is_file a &&
566+
test_path_is_file b &&
567+
test_path_is_file c
568568
)
569569
'
570570

@@ -664,8 +664,8 @@ test_expect_success 'rename/rename/add-dest merge still knows about conflicting
664664
test $(git hash-object b~HEAD) = $(git rev-parse C:b) &&
665665
test $(git hash-object b~B\^0) = $(git rev-parse B:b) &&
666666
667-
test ! -f b &&
668-
test ! -f c
667+
test_path_is_missing b &&
668+
test_path_is_missing c
669669
)
670670
'
671671

0 commit comments

Comments
 (0)