t7004: begin the test body on the same line as test_expect_success
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
AbdAlRahman Gad committed
Aug 8, 2024 at 19:32 UTC
c07b695c1528a18e1b31aca341640d5d6cefbd9d
1 file changed
+71
-54
t/t7004-tag.sh
+71
-54
@@ -61,8 +61,9 @@ test_expect_success 'sort tags, ignore case' '
61
)
62
'
63
64
-test_expect_success 'looking for a tag in an empty tree should fail' \
65
- '! (tag_exists mytag)'
64
+test_expect_success 'looking for a tag in an empty tree should fail' '
65
+ ! (tag_exists mytag)
66
+'
67
68
test_expect_success 'creating a tag in an empty tree should fail' '
69
test_must_fail git tag mynotag &&
@@ -148,25 +149,31 @@ test_expect_success 'listing all tags if one exists should output that tag' '
149
150
# pattern matching:
151
151
-test_expect_success 'listing a tag using a matching pattern should succeed' \
152
- 'git tag -l mytag'
152
+test_expect_success 'listing a tag using a matching pattern should succeed' '
153
+ git tag -l mytag
154
+'
155
154
-test_expect_success 'listing a tag with --ignore-case' \
155
- 'test $(git tag -l --ignore-case MYTAG) = mytag'
156
+test_expect_success 'listing a tag with --ignore-case' '
157
+ test $(git tag -l --ignore-case MYTAG) = mytag
158
+'
159
157
-test_expect_success 'listing a tag using a matching pattern should output that tag' \
158
- 'test $(git tag -l mytag) = mytag'
160
+test_expect_success 'listing a tag using a matching pattern should output that tag' '
161
+ test $(git tag -l mytag) = mytag
162
+'
163
160
-test_expect_success 'listing tags using a non-matching pattern should succeed' \
161
- 'git tag -l xxx'
164
+test_expect_success 'listing tags using a non-matching pattern should succeed' '
165
+ git tag -l xxx
166
+'
167
163
-test_expect_success 'listing tags using a non-matching pattern should output nothing' \
164
- 'test $(git tag -l xxx | wc -l) -eq 0'
168
+test_expect_success 'listing tags using a non-matching pattern should output nothing' '
169
+ test $(git tag -l xxx | wc -l) -eq 0
170
+'
171
172
# special cases for creating tags:
173
168
-test_expect_success 'trying to create a tag with the name of one existing should fail' \
169
- 'test_must_fail git tag mytag'
174
+test_expect_success 'trying to create a tag with the name of one existing should fail' '
175
+ test_must_fail git tag mytag
176
+'
177
178
test_expect_success 'trying to create a tag with a non-valid name should fail' '
179
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
243
! tag_exists nonexistingtag
244
'
245
239
-test_expect_success 'trying to delete an already deleted tag should fail' \
240
- 'test_must_fail git tag -d mytag'
246
+test_expect_success 'trying to delete an already deleted tag should fail' '
247
+ test_must_fail git tag -d mytag
248
+'
249
250
# listing various tags with pattern matching:
251
@@ -417,14 +425,17 @@ test_expect_success 'a non-annotated tag created without parameters should point
425
test $(git rev-parse non-annotated-tag) = $(git rev-parse HEAD)
426
'
427
420
-test_expect_success 'trying to verify an unknown tag should fail' \
421
- 'test_must_fail git tag -v unknown-tag'
428
+test_expect_success 'trying to verify an unknown tag should fail' '
429
+ test_must_fail git tag -v unknown-tag
430
+'
431
423
-test_expect_success 'trying to verify a non-annotated and non-signed tag should fail' \
424
- 'test_must_fail git tag -v non-annotated-tag'
432
+test_expect_success 'trying to verify a non-annotated and non-signed tag should fail' '
433
+ test_must_fail git tag -v non-annotated-tag
434
+'
435
426
-test_expect_success 'trying to verify many non-annotated or unknown tags, should fail' \
427
- 'test_must_fail git tag -v unknown-tag1 non-annotated-tag unknown-tag2'
436
+test_expect_success 'trying to verify many non-annotated or unknown tags, should fail' '
437
+ test_must_fail git tag -v unknown-tag1 non-annotated-tag unknown-tag2
438
+'
439
440
# creating annotated tags:
441
@@ -1014,8 +1025,8 @@ test_expect_success GPG '-s implies annotated tag' '
1025
test_cmp expect actual
1026
'
1027
1017
-test_expect_success GPG 'git tag -s implied if configured with tag.forcesignannotated' \
1018
- 'get_tag_header forcesignannotated-implied-sign $commit commit $time >expect &&
1028
+test_expect_success GPG 'git tag -s implied if configured with tag.forcesignannotated' '
1029
+ get_tag_header forcesignannotated-implied-sign $commit commit $time >expect &&
1030
echo "A message" >>expect &&
1031
echo "-----BEGIN PGP SIGNATURE-----" >>expect &&
1032
test_config tag.forcesignannotated true &&
@@ -1024,15 +1035,15 @@ test_expect_success GPG 'git tag -s implied if configured with tag.forcesignanno
1035
test_cmp expect actual
1036
'
1037
1027
-test_expect_success GPG 'lightweight with no message when configured with tag.forcesignannotated' \
1028
- 'test_config tag.forcesignannotated true &&
1038
+test_expect_success GPG 'lightweight with no message when configured with tag.forcesignannotated' '
1039
+ test_config tag.forcesignannotated true &&
1040
git tag forcesignannotated-lightweight &&
1041
tag_exists forcesignannotated-lightweight &&
1042
test_must_fail git tag -v forcesignannotated-no-message
1043
'
1044
1034
-test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' \
1035
- 'get_tag_header forcesignannotated-annotate $commit commit $time >expect &&
1045
+test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' '
1046
+ get_tag_header forcesignannotated-annotate $commit commit $time >expect &&
1047
echo "A message" >>expect &&
1048
test_config tag.forcesignannotated true &&
1049
git tag -a -m "A message" forcesignannotated-annotate &&
@@ -1041,8 +1052,8 @@ test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' \
1052
test_must_fail git tag -v forcesignannotated-annotate
1053
'
1054
1044
-test_expect_success GPG 'git tag --sign enable GPG sign' \
1045
- 'get_tag_header forcesignannotated-disabled $commit commit $time >expect &&
1055
+test_expect_success GPG 'git tag --sign enable GPG sign' '
1056
+ get_tag_header forcesignannotated-disabled $commit commit $time >expect &&
1057
echo "A message" >>expect &&
1058
echo "-----BEGIN PGP SIGNATURE-----" >>expect &&
1059
test_config tag.forcesignannotated false &&
@@ -1051,8 +1062,8 @@ test_expect_success GPG 'git tag --sign enable GPG sign' \
1062
test_cmp expect actual
1063
'
1064
1054
-test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' \
1055
- 'get_tag_header gpgsign-enabled $commit commit $time >expect &&
1065
+test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' '
1066
+ get_tag_header gpgsign-enabled $commit commit $time >expect &&
1067
echo "A message" >>expect &&
1068
echo "-----BEGIN PGP SIGNATURE-----" >>expect &&
1069
test_config tag.gpgsign true &&
@@ -1061,8 +1072,8 @@ test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' \
1072
test_cmp expect actual
1073
'
1074
1064
-test_expect_success GPG 'git tag --no-sign configured tag.gpgsign skip GPG sign' \
1065
- 'get_tag_header no-sign $commit commit $time >expect &&
1075
+test_expect_success GPG 'git tag --no-sign configured tag.gpgsign skip GPG sign' '
1076
+ get_tag_header no-sign $commit commit $time >expect &&
1077
echo "A message" >>expect &&
1078
test_config tag.gpgsign true &&
1079
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
1088
! tag_exists nosigtag
1089
'
1090
1080
-test_expect_success GPG 'verifying a signed tag should succeed' \
1081
- 'git tag -v signed-tag'
1091
+test_expect_success GPG 'verifying a signed tag should succeed' '
1092
+ git tag -v signed-tag
1093
+'
1094
1083
-test_expect_success GPG 'verifying two signed tags in one command should succeed' \
1084
- 'git tag -v signed-tag file-signed-tag'
1095
+test_expect_success GPG 'verifying two signed tags in one command should succeed' '
1096
+ git tag -v signed-tag file-signed-tag
1097
+'
1098
1099
test_expect_success GPG 'verifying many signed and non-signed tags should fail' '
1100
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' '
1464
'
1465
1466
# try to sign with bad user.signingkey
1454
-test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad key)' \
1455
- 'test_config user.signingkey BobTheMouse &&
1456
- test_must_fail git tag -s -m tail tag-gpg-failure'
1467
+test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad key)' '
1468
+ test_config user.signingkey BobTheMouse &&
1469
+ test_must_fail git tag -s -m tail tag-gpg-failure
1470
+'
1471
1472
# try to produce invalid signature
1459
-test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad signature format)' \
1460
- 'test_config gpg.program echo &&
1461
- test_must_fail git tag -s -m tail tag-gpg-failure'
1473
+test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad signature format)' '
1474
+ test_config gpg.program echo &&
1475
+ test_must_fail git tag -s -m tail tag-gpg-failure
1476
+'
1477
1478
# try to produce invalid signature
1479
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' '
1494
'
1495
1496
# try to sign with bad user.signingkey
1482
-test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad key)' \
1483
- 'test_config user.signingkey BobTheMouse &&
1484
- test_config gpg.format x509 &&
1485
- test_must_fail git tag -s -m tail tag-gpg-failure'
1497
+test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad key)' '
1498
+ test_config user.signingkey BobTheMouse &&
1499
+ test_config gpg.format x509 &&
1500
+ test_must_fail git tag -s -m tail tag-gpg-failure
1501
+'
1502
1503
# try to produce invalid signature
1488
-test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad signature format)' \
1489
- 'test_config gpg.x509.program echo &&
1490
- test_config gpg.format x509 &&
1491
- test_must_fail git tag -s -m tail tag-gpg-failure'
1504
+test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad signature format)' '
1505
+ test_config gpg.x509.program echo &&
1506
+ test_config gpg.format x509 &&
1507
+ test_must_fail git tag -s -m tail tag-gpg-failure
1508
+'
1509
1510
# try to verify without gpg:
1511
1495
-test_expect_success GPG 'verify signed tag fails when public key is not present' \
1496
- 'rm -rf gpghome &&
1512
+test_expect_success GPG 'verify signed tag fails when public key is not present' '
1513
+ rm -rf gpghome &&
1514
test_must_fail git tag -v signed-tag
1515
'
1516