git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: AbdAlRahman Gad <abdobngad@gmail.com>
To: git@vger.kernel.org
Cc: AbdAlRahman Gad <abdobngad@gmail.com>
Subject: [PATCH v6 6/8] t7004: begin the test body on the same line as test_expect_success
Date: Thu,  8 Aug 2024 19:32:05 +0300	[thread overview]
Message-ID: <20240808163302.17521-7-abdobngad@gmail.com> (raw)
In-Reply-To: <20240808163302.17521-1-abdobngad@gmail.com>

Test body should begin with a single quote right after the test
description instead of backslash followed by new line.

Signed-off-by: AbdAlRahman Gad <abdobngad@gmail.com>
---
 t/t7004-tag.sh | 125 ++++++++++++++++++++++++++++---------------------
 1 file changed, 71 insertions(+), 54 deletions(-)

diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 5cbb13a603..2b15ede1f3 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -61,8 +61,9 @@ test_expect_success 'sort tags, ignore case' '
 	)
 '
 
-test_expect_success 'looking for a tag in an empty tree should fail' \
-	'! (tag_exists mytag)'
+test_expect_success 'looking for a tag in an empty tree should fail' '
+	! (tag_exists mytag)
+'
 
 test_expect_success 'creating a tag in an empty tree should fail' '
 	test_must_fail git tag mynotag &&
@@ -148,25 +149,31 @@ test_expect_success 'listing all tags if one exists should output that tag' '
 
 # pattern matching:
 
-test_expect_success 'listing a tag using a matching pattern should succeed' \
-	'git tag -l mytag'
+test_expect_success 'listing a tag using a matching pattern should succeed' '
+	git tag -l mytag
+'
 
-test_expect_success 'listing a tag with --ignore-case' \
-	'test $(git tag -l --ignore-case MYTAG) = mytag'
+test_expect_success 'listing a tag with --ignore-case' '
+	test $(git tag -l --ignore-case MYTAG) = mytag
+'
 
-test_expect_success 'listing a tag using a matching pattern should output that tag' \
-	'test $(git tag -l mytag) = mytag'
+test_expect_success 'listing a tag using a matching pattern should output that tag' '
+	test $(git tag -l mytag) = mytag
+'
 
-test_expect_success 'listing tags using a non-matching pattern should succeed' \
-	'git tag -l xxx'
+test_expect_success 'listing tags using a non-matching pattern should succeed' '
+	git tag -l xxx
+'
 
-test_expect_success 'listing tags using a non-matching pattern should output nothing' \
-	'test $(git tag -l xxx | wc -l) -eq 0'
+test_expect_success 'listing tags using a non-matching pattern should output nothing' '
+	test $(git tag -l xxx | wc -l) -eq 0
+'
 
 # special cases for creating tags:
 
-test_expect_success 'trying to create a tag with the name of one existing should fail' \
-	'test_must_fail git tag mytag'
+test_expect_success 'trying to create a tag with the name of one existing should fail' '
+	test_must_fail git tag mytag
+'
 
 test_expect_success 'trying to create a tag with a non-valid name should fail' '
 	test $(git tag -l | wc -l) -eq 1 &&
@@ -236,8 +243,9 @@ test_expect_success 'trying to delete two tags, existing and not, should fail in
 	! tag_exists nonexistingtag
 '
 
-test_expect_success 'trying to delete an already deleted tag should fail' \
-	'test_must_fail git tag -d mytag'
+test_expect_success 'trying to delete an already deleted tag should fail' '
+	test_must_fail git tag -d mytag
+'
 
 # listing various tags with pattern matching:
 
@@ -417,14 +425,17 @@ test_expect_success 'a non-annotated tag created without parameters should point
 	test $(git rev-parse non-annotated-tag) = $(git rev-parse HEAD)
 '
 
-test_expect_success 'trying to verify an unknown tag should fail' \
-	'test_must_fail git tag -v unknown-tag'
+test_expect_success 'trying to verify an unknown tag should fail' '
+	test_must_fail git tag -v unknown-tag
+'
 
-test_expect_success 'trying to verify a non-annotated and non-signed tag should fail' \
-	'test_must_fail git tag -v non-annotated-tag'
+test_expect_success 'trying to verify a non-annotated and non-signed tag should fail' '
+	test_must_fail git tag -v non-annotated-tag
+'
 
-test_expect_success 'trying to verify many non-annotated or unknown tags, should fail' \
-	'test_must_fail git tag -v unknown-tag1 non-annotated-tag unknown-tag2'
+test_expect_success 'trying to verify many non-annotated or unknown tags, should fail' '
+	test_must_fail git tag -v unknown-tag1 non-annotated-tag unknown-tag2
+'
 
 # creating annotated tags:
 
@@ -1014,8 +1025,8 @@ test_expect_success GPG '-s implies annotated tag' '
 	test_cmp expect actual
 '
 
-test_expect_success GPG 'git tag -s implied if configured with tag.forcesignannotated' \
-	'get_tag_header forcesignannotated-implied-sign $commit commit $time >expect &&
+test_expect_success GPG 'git tag -s implied if configured with tag.forcesignannotated' '
+	get_tag_header forcesignannotated-implied-sign $commit commit $time >expect &&
 	echo "A message" >>expect &&
 	echo "-----BEGIN PGP SIGNATURE-----" >>expect &&
 	test_config tag.forcesignannotated true &&
@@ -1024,15 +1035,15 @@ test_expect_success GPG 'git tag -s implied if configured with tag.forcesignanno
 	test_cmp expect actual
 '
 
-test_expect_success GPG 'lightweight with no message when configured with tag.forcesignannotated' \
-	'test_config tag.forcesignannotated true &&
+test_expect_success GPG 'lightweight with no message when configured with tag.forcesignannotated' '
+	test_config tag.forcesignannotated true &&
 	git tag forcesignannotated-lightweight &&
 	tag_exists forcesignannotated-lightweight &&
 	test_must_fail git tag -v forcesignannotated-no-message
 '
 
-test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' \
-	'get_tag_header forcesignannotated-annotate $commit commit $time >expect &&
+test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' '
+	get_tag_header forcesignannotated-annotate $commit commit $time >expect &&
 	echo "A message" >>expect &&
 	test_config tag.forcesignannotated true &&
 	git tag -a -m "A message" forcesignannotated-annotate &&
@@ -1041,8 +1052,8 @@ test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' \
 	test_must_fail git tag -v forcesignannotated-annotate
 '
 
-test_expect_success GPG 'git tag --sign enable GPG sign' \
-	'get_tag_header forcesignannotated-disabled $commit commit $time >expect &&
+test_expect_success GPG 'git tag --sign enable GPG sign' '
+	get_tag_header forcesignannotated-disabled $commit commit $time >expect &&
 	echo "A message" >>expect &&
 	echo "-----BEGIN PGP SIGNATURE-----" >>expect &&
 	test_config tag.forcesignannotated false &&
@@ -1051,8 +1062,8 @@ test_expect_success GPG 'git tag --sign enable GPG sign' \
 	test_cmp expect actual
 '
 
-test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' \
-	'get_tag_header gpgsign-enabled $commit commit $time >expect &&
+test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' '
+	get_tag_header gpgsign-enabled $commit commit $time >expect &&
 	echo "A message" >>expect &&
 	echo "-----BEGIN PGP SIGNATURE-----" >>expect &&
 	test_config tag.gpgsign true &&
@@ -1061,8 +1072,8 @@ test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' \
 	test_cmp expect actual
 '
 
-test_expect_success GPG 'git tag --no-sign configured tag.gpgsign skip GPG sign' \
-	'get_tag_header no-sign $commit commit $time >expect &&
+test_expect_success GPG 'git tag --no-sign configured tag.gpgsign skip GPG sign' '
+	get_tag_header no-sign $commit commit $time >expect &&
 	echo "A message" >>expect &&
 	test_config tag.gpgsign true &&
 	git tag -a --no-sign -m "A message" no-sign &&
@@ -1077,11 +1088,13 @@ test_expect_success GPG 'trying to create a signed tag with non-existing -F file
 	! tag_exists nosigtag
 '
 
-test_expect_success GPG 'verifying a signed tag should succeed' \
-	'git tag -v signed-tag'
+test_expect_success GPG 'verifying a signed tag should succeed' '
+	git tag -v signed-tag
+'
 
-test_expect_success GPG 'verifying two signed tags in one command should succeed' \
-	'git tag -v signed-tag file-signed-tag'
+test_expect_success GPG 'verifying two signed tags in one command should succeed' '
+	git tag -v signed-tag file-signed-tag
+'
 
 test_expect_success GPG 'verifying many signed and non-signed tags should fail' '
 	test_must_fail git tag -v signed-tag annotated-tag &&
@@ -1451,14 +1464,16 @@ test_expect_success GPG,RFC1991 'reediting a signed tag body omits signature' '
 '
 
 # try to sign with bad user.signingkey
-test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad key)' \
-	'test_config user.signingkey BobTheMouse &&
-	test_must_fail git tag -s -m tail tag-gpg-failure'
+test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad key)' '
+	test_config user.signingkey BobTheMouse &&
+	test_must_fail git tag -s -m tail tag-gpg-failure
+'
 
 # try to produce invalid signature
-test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad signature format)' \
-	'test_config gpg.program echo &&
-	 test_must_fail git tag -s -m tail tag-gpg-failure'
+test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad signature format)' '
+	test_config gpg.program echo &&
+	test_must_fail git tag -s -m tail tag-gpg-failure
+'
 
 # try to produce invalid signature
 test_expect_success GPG 'git verifies tag is valid with double signature' '
@@ -1479,21 +1494,23 @@ test_expect_success GPG 'git verifies tag is valid with double signature' '
 '
 
 # try to sign with bad user.signingkey
-test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad key)' \
-	'test_config user.signingkey BobTheMouse &&
-	 test_config gpg.format x509 &&
-	 test_must_fail git tag -s -m tail tag-gpg-failure'
+test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad key)' '
+	test_config user.signingkey BobTheMouse &&
+	test_config gpg.format x509 &&
+	test_must_fail git tag -s -m tail tag-gpg-failure
+'
 
 # try to produce invalid signature
-test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad signature format)' \
-	'test_config gpg.x509.program echo &&
-	 test_config gpg.format x509 &&
-	 test_must_fail git tag -s -m tail tag-gpg-failure'
+test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad signature format)' '
+	test_config gpg.x509.program echo &&
+	test_config gpg.format x509 &&
+	test_must_fail git tag -s -m tail tag-gpg-failure
+'
 
 # try to verify without gpg:
 
-test_expect_success GPG 'verify signed tag fails when public key is not present' \
-	'rm -rf gpghome &&
+test_expect_success GPG 'verify signed tag fails when public key is not present' '
+	rm -rf gpghome &&
 	test_must_fail git tag -v signed-tag
 '
 
-- 
2.43.0


  parent reply	other threads:[~2024-08-08 16:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08 16:31 [PATCH v6 0/8] [Newcomer] t7004: modernize the style AbdAlRahman Gad
2024-08-08 16:32 ` [PATCH v6 1/8] t7004: remove space after redirect operators AbdAlRahman Gad
2024-08-08 16:32 ` [PATCH v6 2/8] t7004: one command per line AbdAlRahman Gad
2024-08-08 16:32 ` [PATCH v6 3/8] t7004: do not prepare things outside test_expect_success AbdAlRahman Gad
2024-08-08 16:32 ` [PATCH v6 4/8] t7004: use indented here-doc AbdAlRahman Gad
2024-08-08 16:32 ` [PATCH v6 5/8] t7004: description on the same line as test_expect_success AbdAlRahman Gad
2024-08-08 16:32 ` AbdAlRahman Gad [this message]
2024-08-08 16:32 ` [PATCH v6 7/8] t7004: use single quotes instead of double quotes AbdAlRahman Gad
2024-08-08 16:32 ` [PATCH v6 8/8] t7004: make use of write_script AbdAlRahman Gad
2024-08-13 19:57 ` [PATCH v6 0/8] [Newcomer] t7004: modernize the style Eric Sunshine
2024-08-13 21:58   ` AbdAlRahman Gad

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240808163302.17521-7-abdobngad@gmail.com \
    --to=abdobngad@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).