From: Elijah Newren <newren@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, Elijah Newren <newren@gmail.com>
Subject: [PATCH 3/5] t6036, t6042: prefer test_path_is_file, test_path_is_missing
Date: Thu, 24 May 2018 00:04:37 -0700 [thread overview]
Message-ID: <20180524070439.6367-4-newren@gmail.com> (raw)
In-Reply-To: <20180524070439.6367-1-newren@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
---
t/t6036-recursive-corner-cases.sh | 4 +--
t/t6042-merge-rename-corner-cases.sh | 40 ++++++++++++++--------------
2 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/t/t6036-recursive-corner-cases.sh b/t/t6036-recursive-corner-cases.sh
index 3e659cff28..b716155723 100755
--- a/t/t6036-recursive-corner-cases.sh
+++ b/t/t6036-recursive-corner-cases.sh
@@ -488,7 +488,7 @@ test_expect_success 'merge of D & E2 fails but has appropriate contents' '
test $(git rev-parse :1:a/file) = $(git rev-parse C:a/file) &&
test $(git rev-parse :0:ignore-me) = $(git rev-parse A:ignore-me) &&
- test -f a~HEAD
+ test_path_is_file a~HEAD
)
'
@@ -512,7 +512,7 @@ test_expect_success 'merge of E2 & D fails but has appropriate contents' '
test $(git rev-parse :1:a/file) = $(git rev-parse C:a/file) &&
test $(git rev-parse :0:ignore-me) = $(git rev-parse A:ignore-me) &&
- test -f a~D^0
+ test_path_is_file a~D^0
)
'
diff --git a/t/t6042-merge-rename-corner-cases.sh b/t/t6042-merge-rename-corner-cases.sh
index b76da8fcdf..90225b8bcd 100755
--- a/t/t6042-merge-rename-corner-cases.sh
+++ b/t/t6042-merge-rename-corner-cases.sh
@@ -38,7 +38,7 @@ test_expect_success "Does git preserve Gollum's precious artifact?" '
test_must_fail git merge -s recursive rename-the-ring &&
# Make sure git did not delete an untracked file
- test -f ring
+ test_path_is_file ring
)
'
@@ -213,8 +213,8 @@ test_expect_failure 'detect rename/add-source and preserve all data' '
git ls-files -o >out &&
test_line_count = 1 out &&
- test -f a &&
- test -f b &&
+ test_path_is_file a &&
+ test_path_is_file b &&
test $(git rev-parse HEAD:b) = $(git rev-parse A:a) &&
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
git ls-files -o >out &&
test_line_count = 1 out &&
- test -f a &&
- test -f b &&
+ test_path_is_file a &&
+ test_path_is_file b &&
test $(git rev-parse HEAD:b) = $(git rev-parse A:a) &&
test $(git rev-parse HEAD:a) = $(git rev-parse C:a)
@@ -302,8 +302,8 @@ test_expect_success 'rename/directory conflict + clean content merge' '
test $(git rev-parse :2:newfile) = $(git hash-object expect) &&
- test -f newfile/realfile &&
- test -f newfile~HEAD
+ test_path_is_file newfile/realfile &&
+ test_path_is_file newfile~HEAD
)
'
@@ -340,8 +340,8 @@ test_expect_success 'rename/directory conflict + content merge conflict' '
test $(git rev-parse :2:newfile) = $(git rev-parse left-conflict:newfile) &&
test $(git rev-parse :3:newfile) = $(git rev-parse right:file) &&
- test -f newfile/realfile &&
- test -f newfile~HEAD
+ test_path_is_file newfile/realfile &&
+ test_path_is_file newfile~HEAD
)
'
@@ -394,7 +394,7 @@ test_expect_success 'disappearing dir in rename/directory conflict handled' '
echo 7 >>expect &&
test_cmp expect sub &&
- test -f sub
+ test_path_is_file sub
)
'
@@ -453,10 +453,10 @@ test_expect_success 'handle rename/rename (2to1) conflict correctly' '
git ls-files -o >out &&
test_line_count = 3 out &&
- test ! -f a &&
- test ! -f b &&
- test -f c~HEAD &&
- test -f c~C^0 &&
+ test_path_is_missing a &&
+ test_path_is_missing b &&
+ test_path_is_file c~HEAD &&
+ test_path_is_file c~C^0 &&
test $(git hash-object c~HEAD) = $(git rev-parse C:a) &&
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' '
test $(git rev-parse :3:b) = $(git rev-parse A:a) &&
test $(git rev-parse :2:c) = $(git rev-parse A:a) &&
- test ! -f a &&
+ test_path_is_missing a &&
test $(git hash-object b) = $(git rev-parse A:a) &&
test $(git hash-object c) = $(git rev-parse A:a)
)
@@ -562,9 +562,9 @@ test_expect_failure 'detect conflict with rename/rename(1to2)/add-source merge'
test $(git rev-parse 2:b) = $(git rev-parse B:b) &&
test $(git rev-parse 3:c) = $(git rev-parse C:c) &&
- test -f a &&
- test -f b &&
- test -f c
+ test_path_is_file a &&
+ test_path_is_file b &&
+ test_path_is_file c
)
'
@@ -664,8 +664,8 @@ test_expect_success 'rename/rename/add-dest merge still knows about conflicting
test $(git hash-object b~HEAD) = $(git rev-parse C:b) &&
test $(git hash-object b~B\^0) = $(git rev-parse B:b) &&
- test ! -f b &&
- test ! -f c
+ test_path_is_missing b &&
+ test_path_is_missing c
)
'
--
2.17.0.1.gda85003413
next prev parent reply other threads:[~2018-05-24 7:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-24 7:04 [PATCH 0/5] Modernize some testcases for merge-recursive corner cases Elijah Newren
2018-05-24 7:04 ` [PATCH 1/5] t6036, t6042: use test_create_repo to keep tests independent Elijah Newren
2018-05-24 7:04 ` [PATCH 2/5] t6036, t6042: use test_line_count instead of wc -l Elijah Newren
2018-05-24 10:05 ` SZEDER Gábor
2018-05-24 10:36 ` SZEDER Gábor
2018-05-24 17:03 ` Elijah Newren
2018-05-25 1:17 ` Junio C Hamano
2018-05-26 0:44 ` Elijah Newren
2018-05-24 7:04 ` Elijah Newren [this message]
2018-05-24 7:04 ` [PATCH 4/5] t6036, t6042: prefer test_cmp to sequences of test Elijah Newren
2018-05-24 7:04 ` [PATCH 5/5] t6036: prefer test_when_finished to manual cleanup in following test Elijah Newren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180524070439.6367-4-newren@gmail.com \
--to=newren@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).