aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-04-08 10:19:15 -0700
committerJunio C Hamano <gitster@pobox.com>2026-04-08 10:19:15 -0700
commit2e3028a58c1f1fbf08538443fc30a48ac4f6bacf (patch)
tree4939ebda9d8d83f1161ad382f5179f5ae91f75a6 /t
parent373d43e0829d91c61f35f46f6715a23adda7b35d (diff)
parent42148dafdf74f8458e7a710dcb982c0be0e40566 (diff)
downloadgit-2e3028a58c1f1fbf08538443fc30a48ac4f6bacf.tar.xz
Merge branch 'ss/t7004-unhide-git-failures'
Test clean-up. * ss/t7004-unhide-git-failures: t7004: replace wc -l with modern test helpers
Diffstat (limited to 't')
-rwxr-xr-xt/t7004-tag.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index ce2ff2a28a..faf7d97fc4 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -33,8 +33,10 @@ test_expect_success 'listing all tags in an empty tree should succeed' '
'
test_expect_success 'listing all tags in an empty tree should output nothing' '
- test $(git tag -l | wc -l) -eq 0 &&
- test $(git tag | wc -l) -eq 0
+ git tag -l >actual &&
+ test_must_be_empty actual &&
+ git tag >actual &&
+ test_must_be_empty actual
'
test_expect_success 'sort tags, ignore case' '
@@ -178,7 +180,8 @@ test_expect_success 'listing tags using a non-matching pattern should succeed' '
'
test_expect_success 'listing tags using a non-matching pattern should output nothing' '
- test $(git tag -l xxx | wc -l) -eq 0
+ git tag -l xxx >actual &&
+ test_must_be_empty actual
'
# special cases for creating tags:
@@ -188,13 +191,15 @@ test_expect_success 'trying to create a tag with the name of one existing should
'
test_expect_success 'trying to create a tag with a non-valid name should fail' '
- test $(git tag -l | wc -l) -eq 1 &&
+ git tag -l >actual &&
+ test_line_count = 1 actual &&
test_must_fail git tag "" &&
test_must_fail git tag .othertag &&
test_must_fail git tag "other tag" &&
test_must_fail git tag "othertag^" &&
test_must_fail git tag "other~tag" &&
- test $(git tag -l | wc -l) -eq 1
+ git tag -l >actual &&
+ test_line_count = 1 actual
'
test_expect_success 'creating a tag using HEAD directly should succeed' '