t9001: style modernisation phase #5
Two general shell script codingstyles around here-text. - Quote the <<\END_OF_HERE_TEXT string when there is no parameter substitution going on to reduce cognitive load of the reader. - Indent the text with <<-\END_OF_HERE_TEXT when able to make it easier to spot boundaries of the tests. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Nov 25, 2014 at 15:03 UTC
0720a51b29cdeb3927280669557068e636913128
1 file changed
+74
-76
t/t9001-send-email.sh
+74
-76
@@ -88,12 +88,12 @@ test_expect_success $PREREQ 'Send patches' '
88
'
89
90
test_expect_success $PREREQ 'setup expect' '
91
-cat >expected <<\EOF
92
-!nobody@example.com!
93
-!author@example.com!
94
-!one@example.com!
95
-!two@example.com!
96
-EOF
91
+ cat >expected <<-\EOF
92
+ !nobody@example.com!
93
+ !author@example.com!
94
+ !one@example.com!
95
+ !two@example.com!
96
+ EOF
97
'
98
99
test_expect_success $PREREQ 'Verify commandline' '
@@ -106,14 +106,14 @@ test_expect_success $PREREQ 'Send patches with --envelope-sender' '
106
'
107
108
test_expect_success $PREREQ 'setup expect' '
109
-cat >expected <<\EOF
110
-!patch@example.com!
111
-!-i!
112
-!nobody@example.com!
113
-!author@example.com!
114
-!one@example.com!
115
-!two@example.com!
116
-EOF
109
+ cat >expected <<-\EOF
110
+ !patch@example.com!
111
+ !-i!
112
+ !nobody@example.com!
113
+ !author@example.com!
114
+ !one@example.com!
115
+ !two@example.com!
116
+ EOF
117
'
118
119
test_expect_success $PREREQ 'Verify commandline' '
@@ -126,14 +126,14 @@ test_expect_success $PREREQ 'Send patches with --envelope-sender=auto' '
126
'
127
128
test_expect_success $PREREQ 'setup expect' '
129
-cat >expected <<\EOF
130
-!nobody@example.com!
131
-!-i!
132
-!nobody@example.com!
133
-!author@example.com!
134
-!one@example.com!
135
-!two@example.com!
136
-EOF
129
+ cat >expected <<-\EOF
130
+ !nobody@example.com!
131
+ !-i!
132
+ !nobody@example.com!
133
+ !author@example.com!
134
+ !one@example.com!
135
+ !two@example.com!
136
+ EOF
137
'
138
139
test_expect_success $PREREQ 'Verify commandline' '
@@ -1192,7 +1192,7 @@ test_expect_success $PREREQ 'To headers from files reset each patch' '
1192
'
1193
1194
test_expect_success $PREREQ 'setup expect' '
1195
-cat >email-using-8bit <<EOF
1195
+cat >email-using-8bit <<\EOF
1196
From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
1197
Message-Id: <bogus-message-id@example.com>
1198
From: author@example.com
@@ -1204,9 +1204,7 @@ EOF
1204
'
1205
1206
test_expect_success $PREREQ 'setup expect' '
1207
-cat >expected <<EOF
1208
-Subject: subject goes here
1209
-EOF
1207
+ echo "Subject: subject goes here" >expected
1208
'
1209
1210
test_expect_success $PREREQ 'ASCII subject is not RFC2047 quoted' '
@@ -1221,11 +1219,11 @@ test_expect_success $PREREQ 'ASCII subject is not RFC2047 quoted' '
1219
'
1220
1221
test_expect_success $PREREQ 'setup expect' '
1224
-cat >content-type-decl <<EOF
1225
-MIME-Version: 1.0
1226
-Content-Type: text/plain; charset=UTF-8
1227
-Content-Transfer-Encoding: 8bit
1228
-EOF
1222
+ cat >content-type-decl <<-\EOF
1223
+ MIME-Version: 1.0
1224
+ Content-Type: text/plain; charset=UTF-8
1225
+ Content-Transfer-Encoding: 8bit
1226
+ EOF
1227
'
1228
1229
test_expect_success $PREREQ 'asks about and fixes 8bit encodings' '
@@ -1265,21 +1263,21 @@ test_expect_success $PREREQ '--8bit-encoding overrides sendemail.8bitEncoding' '
1263
'
1264
1265
test_expect_success $PREREQ 'setup expect' '
1268
-cat >email-using-8bit <<EOF
1269
-From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
1270
-Message-Id: <bogus-message-id@example.com>
1271
-From: author@example.com
1272
-Date: Sat, 12 Jun 2010 15:53:58 +0200
1273
-Subject: Dieser Betreff enthält auch einen Umlaut!
1274
-
1275
-Nothing to see here.
1276
-EOF
1266
+ cat >email-using-8bit <<-\EOF
1267
+ From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
1268
+ Message-Id: <bogus-message-id@example.com>
1269
+ From: author@example.com
1270
+ Date: Sat, 12 Jun 2010 15:53:58 +0200
1271
+ Subject: Dieser Betreff enthält auch einen Umlaut!
1272
+
1273
+ Nothing to see here.
1274
+ EOF
1275
'
1276
1277
test_expect_success $PREREQ 'setup expect' '
1280
-cat >expected <<EOF
1281
-Subject: =?UTF-8?q?Dieser=20Betreff=20enth=C3=A4lt=20auch=20einen=20Umlaut!?=
1282
-EOF
1278
+ cat >expected <<-\EOF
1279
+ Subject: =?UTF-8?q?Dieser=20Betreff=20enth=C3=A4lt=20auch=20einen=20Umlaut!?=
1280
+ EOF
1281
'
1282
1283
test_expect_success $PREREQ '--8bit-encoding also treats subject' '
@@ -1294,16 +1292,16 @@ test_expect_success $PREREQ '--8bit-encoding also treats subject' '
1292
'
1293
1294
test_expect_success $PREREQ 'setup expect' '
1297
-cat >email-using-8bit <<EOF
1298
-From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
1299
-Message-Id: <bogus-message-id@example.com>
1300
-From: A U Thor <author@example.com>
1301
-Date: Sat, 12 Jun 2010 15:53:58 +0200
1302
-Content-Type: text/plain; charset=UTF-8
1303
-Subject: Nothing to see here.
1304
-
1305
-Dieser Betreff enthält auch einen Umlaut!
1306
-EOF
1295
+ cat >email-using-8bit <<-\EOF
1296
+ From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
1297
+ Message-Id: <bogus-message-id@example.com>
1298
+ From: A U Thor <author@example.com>
1299
+ Date: Sat, 12 Jun 2010 15:53:58 +0200
1300
+ Content-Type: text/plain; charset=UTF-8
1301
+ Subject: Nothing to see here.
1302
+
1303
+ Dieser Betreff enthält auch einen Umlaut!
1304
+ EOF
1305
'
1306
1307
test_expect_success $PREREQ 'sendemail.transferencoding=7bit fails on 8bit data' '
@@ -1343,9 +1341,9 @@ test_expect_success $PREREQ 'sendemail.transferencoding=8bit' '
1341
'
1342
1343
test_expect_success $PREREQ 'setup expect' '
1346
-cat >expected <<EOF
1347
-Dieser Betreff enth=C3=A4lt auch einen Umlaut!
1348
-EOF
1344
+ cat >expected <<-\EOF
1345
+ Dieser Betreff enth=C3=A4lt auch einen Umlaut!
1346
+ EOF
1347
'
1348
1349
test_expect_success $PREREQ '8-bit and sendemail.transferencoding=quoted-printable' '
@@ -1360,9 +1358,9 @@ test_expect_success $PREREQ '8-bit and sendemail.transferencoding=quoted-printab
1358
'
1359
1360
test_expect_success $PREREQ 'setup expect' '
1363
-cat >expected <<EOF
1364
-RGllc2VyIEJldHJlZmYgZW50aMOkbHQgYXVjaCBlaW5lbiBVbWxhdXQhCg==
1365
-EOF
1361
+ cat >expected <<-\EOF
1362
+ RGllc2VyIEJldHJlZmYgZW50aMOkbHQgYXVjaCBlaW5lbiBVbWxhdXQhCg==
1363
+ EOF
1364
'
1365
1366
test_expect_success $PREREQ '8-bit and sendemail.transferencoding=base64' '
@@ -1377,18 +1375,18 @@ test_expect_success $PREREQ '8-bit and sendemail.transferencoding=base64' '
1375
'
1376
1377
test_expect_success $PREREQ 'setup expect' '
1380
-cat >email-using-qp <<EOF
1381
-From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
1382
-Message-Id: <bogus-message-id@example.com>
1383
-From: A U Thor <author@example.com>
1384
-Date: Sat, 12 Jun 2010 15:53:58 +0200
1385
-MIME-Version: 1.0
1386
-Content-Transfer-Encoding: quoted-printable
1387
-Content-Type: text/plain; charset=UTF-8
1388
-Subject: Nothing to see here.
1378
+ cat >email-using-qp <<-\EOF
1379
+ From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
1380
+ Message-Id: <bogus-message-id@example.com>
1381
+ From: A U Thor <author@example.com>
1382
+ Date: Sat, 12 Jun 2010 15:53:58 +0200
1383
+ MIME-Version: 1.0
1384
+ Content-Transfer-Encoding: quoted-printable
1385
+ Content-Type: text/plain; charset=UTF-8
1386
+ Subject: Nothing to see here.
1387
1390
-Dieser Betreff enth=C3=A4lt auch einen Umlaut!
1391
-EOF
1388
+ Dieser Betreff enth=C3=A4lt auch einen Umlaut!
1389
+ EOF
1390
'
1391
1392
test_expect_success $PREREQ 'convert from quoted-printable to base64' '
@@ -1416,9 +1414,9 @@ EOF
1414
"
1415
1416
test_expect_success $PREREQ 'setup expect' '
1419
-cat >expected <<EOF
1420
-Look, I have a CRLF and an =3D sign!=0D
1421
-EOF
1417
+ cat >expected <<-\EOF
1418
+ Look, I have a CRLF and an =3D sign!=0D
1419
+ EOF
1420
'
1421
1422
test_expect_success $PREREQ 'CRLF and sendemail.transferencoding=quoted-printable' '
@@ -1433,9 +1431,9 @@ test_expect_success $PREREQ 'CRLF and sendemail.transferencoding=quoted-printabl
1431
'
1432
1433
test_expect_success $PREREQ 'setup expect' '
1436
-cat >expected <<EOF
1437
-TG9vaywgSSBoYXZlIGEgQ1JMRiBhbmQgYW4gPSBzaWduIQ0K
1438
-EOF
1434
+ cat >expected <<-\EOF
1435
+ TG9vaywgSSBoYXZlIGEgQ1JMRiBhbmQgYW4gPSBzaWduIQ0K
1436
+ EOF
1437
'
1438
1439
test_expect_success $PREREQ 'CRLF and sendemail.transferencoding=base64' '