@@ -85,12 +85,15 @@ test_expect_success $PREREQ 'Send patches' '
85
85
git send-email --suppress-cc=sob --from="Example <[email protected] >" [email protected] --smtp-server="$(pwd)/fake.sendmail" $patches 2>errors
86
86
'
87
87
88
+ test_expect_success $PREREQ ' setup expect' '
88
89
cat >expected <<\EOF
89
90
90
91
91
92
92
93
93
94
EOF
95
+ '
96
+
94
97
test_expect_success $PREREQ \
95
98
' Verify commandline' \
96
99
' test_cmp expected commandline1'
@@ -100,6 +103,7 @@ test_expect_success $PREREQ 'Send patches with --envelope-sender' '
100
103
git send-email --envelope-sender="Patch Contributer <[email protected] >" --suppress-cc=sob --from="Example <[email protected] >" [email protected] --smtp-server="$(pwd)/fake.sendmail" $patches 2>errors
101
104
'
102
105
106
+ test_expect_success $PREREQ ' setup expect' '
103
107
cat >expected <<\EOF
104
108
105
109
!-i!
@@ -108,6 +112,8 @@ cat >expected <<\EOF
108
112
109
113
110
114
EOF
115
+ '
116
+
111
117
test_expect_success $PREREQ \
112
118
' Verify commandline' \
113
119
' test_cmp expected commandline1'
@@ -117,6 +123,7 @@ test_expect_success $PREREQ 'Send patches with --envelope-sender=auto' '
117
123
git send-email --envelope-sender=auto --suppress-cc=sob --from="Example <[email protected] >" [email protected] --smtp-server="$(pwd)/fake.sendmail" $patches 2>errors
118
124
'
119
125
126
+ test_expect_success $PREREQ ' setup expect' '
120
127
cat >expected <<\EOF
121
128
122
129
!-i!
@@ -125,10 +132,13 @@ cat >expected <<\EOF
125
132
126
133
127
134
EOF
135
+ '
136
+
128
137
test_expect_success $PREREQ \
129
138
' Verify commandline' \
130
139
' test_cmp expected commandline1'
131
140
141
+ test_expect_success $PREREQ ' setup expect' "
132
142
cat >expected-show-all-headers <<\EOF
133
143
0001-Second.patch
134
144
(mbox) Adding cc: A <[email protected] > from line 'From: A <[email protected] >'
158
168
159
169
Result: OK
160
170
EOF
171
+ "
161
172
162
173
test_expect_success $PREREQ ' Show all headers' '
163
174
git send-email \
@@ -209,10 +220,10 @@ test_expect_success $PREREQ 'cccmd works' '
209
220
grep "^ [email protected] " msgtxt1
210
221
'
211
222
212
- z8=zzzzzzzz
213
- z64=$z8$z8$z8$z8$z8$z8$z8$z8
214
- z512=$z64$z64$z64$z64$z64$z64$z64$z64
215
223
test_expect_success $PREREQ ' reject long lines' '
224
+ z8=zzzzzzzz &&
225
+ z64=$z8$z8$z8$z8$z8$z8$z8$z8 &&
226
+ z512=$z64$z64$z64$z64$z64$z64$z64$z64 &&
216
227
clean_fake_sendmail &&
217
228
cp $patches longline.patch &&
218
229
echo $z512$z512 >>longline.patch &&
@@ -312,6 +323,7 @@ test_expect_success $PREREQ 'second message is patch' '
312
323
grep "Subject:.*Second" msgtxt2
313
324
'
314
325
326
+ test_expect_success $PREREQ ' setup expect' "
315
327
cat >expected-suppress-sob <<\EOF
316
328
0001-Second.patch
317
329
(mbox) Adding cc: A <[email protected] > from line 'From: A <[email protected] >'
@@ -338,6 +350,7 @@ X-Mailer: X-MAILER-STRING
338
350
339
351
Result: OK
340
352
EOF
353
+ "
341
354
342
355
test_suppression () {
343
356
git send-email \
@@ -359,6 +372,7 @@ test_expect_success $PREREQ 'sendemail.cc set' '
359
372
test_suppression sob
360
373
'
361
374
375
+ test_expect_success $PREREQ ' setup expect' "
362
376
cat >expected-suppress-sob <<\EOF
363
377
0001-Second.patch
364
378
(mbox) Adding cc: A <[email protected] > from line 'From: A <[email protected] >'
@@ -383,12 +397,14 @@ X-Mailer: X-MAILER-STRING
383
397
384
398
Result: OK
385
399
EOF
400
+ "
386
401
387
402
test_expect_success $PREREQ ' sendemail.cc unset' '
388
403
git config --unset sendemail.cc &&
389
404
test_suppression sob
390
405
'
391
406
407
+ test_expect_success $PREREQ ' setup expect' "
392
408
cat >expected-suppress-cccmd <<\EOF
393
409
0001-Second.patch
394
410
(mbox) Adding cc: A <[email protected] > from line 'From: A <[email protected] >'
@@ -416,6 +432,7 @@ X-Mailer: X-MAILER-STRING
416
432
417
433
Result: OK
418
434
EOF
435
+ "
419
436
420
437
test_expect_success $PREREQ ' sendemail.cccmd' '
421
438
echo echo [email protected] > cccmd &&
@@ -424,6 +441,7 @@ test_expect_success $PREREQ 'sendemail.cccmd' '
424
441
test_suppression cccmd
425
442
'
426
443
444
+ test_expect_success $PREREQ ' setup expect' '
427
445
cat >expected-suppress-all <<\EOF
428
446
0001-Second.patch
429
447
Dry-OK. Log says:
@@ -439,11 +457,13 @@ X-Mailer: X-MAILER-STRING
439
457
440
458
Result: OK
441
459
EOF
460
+ '
442
461
443
462
test_expect_success $PREREQ ' --suppress-cc=all' '
444
463
test_suppression all
445
464
'
446
465
466
+ test_expect_success $PREREQ ' setup expect' "
447
467
cat >expected-suppress-body <<\EOF
448
468
0001-Second.patch
449
469
(mbox) Adding cc: A <[email protected] > from line 'From: A <[email protected] >'
@@ -471,11 +491,13 @@ X-Mailer: X-MAILER-STRING
471
491
472
492
Result: OK
473
493
EOF
494
+ "
474
495
475
496
test_expect_success $PREREQ ' --suppress-cc=body' '
476
497
test_suppression body
477
498
'
478
499
500
+ test_expect_success $PREREQ ' setup expect' "
479
501
cat >expected-suppress-body-cccmd <<\EOF
480
502
0001-Second.patch
481
503
(mbox) Adding cc: A <[email protected] > from line 'From: A <[email protected] >'
@@ -500,11 +522,13 @@ X-Mailer: X-MAILER-STRING
500
522
501
523
Result: OK
502
524
EOF
525
+ "
503
526
504
527
test_expect_success $PREREQ ' --suppress-cc=body --suppress-cc=cccmd' '
505
528
test_suppression body cccmd
506
529
'
507
530
531
+ test_expect_success $PREREQ ' setup expect' "
508
532
cat >expected-suppress-sob <<\EOF
509
533
0001-Second.patch
510
534
(mbox) Adding cc: A <[email protected] > from line 'From: A <[email protected] >'
@@ -529,12 +553,14 @@ X-Mailer: X-MAILER-STRING
529
553
530
554
Result: OK
531
555
EOF
556
+ "
532
557
533
558
test_expect_success $PREREQ ' --suppress-cc=sob' '
534
559
git config --unset sendemail.cccmd
535
560
test_suppression sob
536
561
'
537
562
563
+ test_expect_success $PREREQ ' setup expect' "
538
564
cat >expected-suppress-bodycc <<\EOF
539
565
0001-Second.patch
540
566
(mbox) Adding cc: A <[email protected] > from line 'From: A <[email protected] >'
@@ -562,11 +588,13 @@ X-Mailer: X-MAILER-STRING
562
588
563
589
Result: OK
564
590
EOF
591
+ "
565
592
566
593
test_expect_success $PREREQ ' --suppress-cc=bodycc' '
567
594
test_suppression bodycc
568
595
'
569
596
597
+ test_expect_success $PREREQ ' setup expect' "
570
598
cat >expected-suppress-cc <<\EOF
571
599
0001-Second.patch
572
600
(mbox) Adding cc: A <[email protected] > from line 'From: A <[email protected] >'
@@ -588,6 +616,7 @@ X-Mailer: X-MAILER-STRING
588
616
589
617
Result: OK
590
618
EOF
619
+ "
591
620
592
621
test_expect_success $PREREQ ' --suppress-cc=cc' '
593
622
test_suppression cc
@@ -918,6 +947,7 @@ test_expect_success $PREREQ '--no-bcc overrides sendemail.bcc' '
918
947
! grep "RCPT TO:<[email protected] >" stdout
919
948
'
920
949
950
+ test_expect_success $PREREQ ' setup expect' '
921
951
cat >email-using-8bit <<EOF
922
952
From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
923
953
@@ -927,12 +957,15 @@ Subject: subject goes here
927
957
928
958
Dieser deutsche Text enthält einen Umlaut!
929
959
EOF
960
+ '
930
961
962
+ test_expect_success $PREREQ ' setup expect' '
931
963
cat >content-type-decl <<EOF
932
964
MIME-Version: 1.0
933
965
Content-Type: text/plain; charset=UTF-8
934
966
Content-Transfer-Encoding: 8bit
935
967
EOF
968
+ '
936
969
937
970
test_expect_success $PREREQ ' asks about and fixes 8bit encodings' '
938
971
clean_fake_sendmail &&
@@ -970,6 +1003,7 @@ test_expect_success $PREREQ '--8bit-encoding overrides sendemail.8bitEncoding' '
970
1003
test_cmp actual content-type-decl
971
1004
'
972
1005
1006
+ test_expect_success $PREREQ ' setup expect' '
973
1007
cat >email-using-8bit <<EOF
974
1008
From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
975
1009
@@ -979,10 +1013,13 @@ Subject: Dieser Betreff enthält auch einen Umlaut!
979
1013
980
1014
Nothing to see here.
981
1015
EOF
1016
+ '
982
1017
1018
+ test_expect_success $PREREQ ' setup expect' '
983
1019
cat >expected <<EOF
984
1020
Subject: =?UTF-8?q?Dieser=20Betreff=20enth=C3=A4lt=20auch=20einen=20Umlaut!?=
985
1021
EOF
1022
+ '
986
1023
987
1024
test_expect_success $PREREQ ' --8bit-encoding also treats subject' '
988
1025
clean_fake_sendmail &&
0 commit comments