From 0720a51b29cdeb3927280669557068e636913128 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 25 Nov 2014 15:03:45 -0800 Subject: 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 --- t/t9001-send-email.sh | 150 +++++++++++++++++++++++++------------------------- 1 file changed, 74 insertions(+), 76 deletions(-) diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 8aa7c0335f..e37efef5ca 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -88,12 +88,12 @@ test_expect_success $PREREQ 'Send patches' ' ' test_expect_success $PREREQ 'setup expect' ' -cat >expected <<\EOF -!nobody@example.com! -!author@example.com! -!one@example.com! -!two@example.com! -EOF + cat >expected <<-\EOF + !nobody@example.com! + !author@example.com! + !one@example.com! + !two@example.com! + EOF ' test_expect_success $PREREQ 'Verify commandline' ' @@ -106,14 +106,14 @@ test_expect_success $PREREQ 'Send patches with --envelope-sender' ' ' test_expect_success $PREREQ 'setup expect' ' -cat >expected <<\EOF -!patch@example.com! -!-i! -!nobody@example.com! -!author@example.com! -!one@example.com! -!two@example.com! -EOF + cat >expected <<-\EOF + !patch@example.com! + !-i! + !nobody@example.com! + !author@example.com! + !one@example.com! + !two@example.com! + EOF ' test_expect_success $PREREQ 'Verify commandline' ' @@ -126,14 +126,14 @@ test_expect_success $PREREQ 'Send patches with --envelope-sender=auto' ' ' test_expect_success $PREREQ 'setup expect' ' -cat >expected <<\EOF -!nobody@example.com! -!-i! -!nobody@example.com! -!author@example.com! -!one@example.com! -!two@example.com! -EOF + cat >expected <<-\EOF + !nobody@example.com! + !-i! + !nobody@example.com! + !author@example.com! + !one@example.com! + !two@example.com! + EOF ' test_expect_success $PREREQ 'Verify commandline' ' @@ -1192,7 +1192,7 @@ test_expect_success $PREREQ 'To headers from files reset each patch' ' ' test_expect_success $PREREQ 'setup expect' ' -cat >email-using-8bit <email-using-8bit <<\EOF From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001 Message-Id: From: author@example.com @@ -1204,9 +1204,7 @@ EOF ' test_expect_success $PREREQ 'setup expect' ' -cat >expected <expected ' test_expect_success $PREREQ 'ASCII subject is not RFC2047 quoted' ' @@ -1221,11 +1219,11 @@ test_expect_success $PREREQ 'ASCII subject is not RFC2047 quoted' ' ' test_expect_success $PREREQ 'setup expect' ' -cat >content-type-decl <content-type-decl <<-\EOF + MIME-Version: 1.0 + Content-Type: text/plain; charset=UTF-8 + Content-Transfer-Encoding: 8bit + EOF ' test_expect_success $PREREQ 'asks about and fixes 8bit encodings' ' @@ -1265,21 +1263,21 @@ test_expect_success $PREREQ '--8bit-encoding overrides sendemail.8bitEncoding' ' ' test_expect_success $PREREQ 'setup expect' ' -cat >email-using-8bit < -From: author@example.com -Date: Sat, 12 Jun 2010 15:53:58 +0200 -Subject: Dieser Betreff enthält auch einen Umlaut! - -Nothing to see here. -EOF + cat >email-using-8bit <<-\EOF + From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001 + Message-Id: + From: author@example.com + Date: Sat, 12 Jun 2010 15:53:58 +0200 + Subject: Dieser Betreff enthält auch einen Umlaut! + + Nothing to see here. + EOF ' test_expect_success $PREREQ 'setup expect' ' -cat >expected <expected <<-\EOF + Subject: =?UTF-8?q?Dieser=20Betreff=20enth=C3=A4lt=20auch=20einen=20Umlaut!?= + EOF ' test_expect_success $PREREQ '--8bit-encoding also treats subject' ' @@ -1294,16 +1292,16 @@ test_expect_success $PREREQ '--8bit-encoding also treats subject' ' ' test_expect_success $PREREQ 'setup expect' ' -cat >email-using-8bit < -From: A U Thor -Date: Sat, 12 Jun 2010 15:53:58 +0200 -Content-Type: text/plain; charset=UTF-8 -Subject: Nothing to see here. - -Dieser Betreff enthält auch einen Umlaut! -EOF + cat >email-using-8bit <<-\EOF + From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001 + Message-Id: + From: A U Thor + Date: Sat, 12 Jun 2010 15:53:58 +0200 + Content-Type: text/plain; charset=UTF-8 + Subject: Nothing to see here. + + Dieser Betreff enthält auch einen Umlaut! + EOF ' test_expect_success $PREREQ 'sendemail.transferencoding=7bit fails on 8bit data' ' @@ -1343,9 +1341,9 @@ test_expect_success $PREREQ 'sendemail.transferencoding=8bit' ' ' test_expect_success $PREREQ 'setup expect' ' -cat >expected <expected <<-\EOF + Dieser Betreff enth=C3=A4lt auch einen Umlaut! + EOF ' 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 ' test_expect_success $PREREQ 'setup expect' ' -cat >expected <expected <<-\EOF + RGllc2VyIEJldHJlZmYgZW50aMOkbHQgYXVjaCBlaW5lbiBVbWxhdXQhCg== + EOF ' test_expect_success $PREREQ '8-bit and sendemail.transferencoding=base64' ' @@ -1377,18 +1375,18 @@ test_expect_success $PREREQ '8-bit and sendemail.transferencoding=base64' ' ' test_expect_success $PREREQ 'setup expect' ' -cat >email-using-qp < -From: A U Thor -Date: Sat, 12 Jun 2010 15:53:58 +0200 -MIME-Version: 1.0 -Content-Transfer-Encoding: quoted-printable -Content-Type: text/plain; charset=UTF-8 -Subject: Nothing to see here. + cat >email-using-qp <<-\EOF + From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001 + Message-Id: + From: A U Thor + Date: Sat, 12 Jun 2010 15:53:58 +0200 + MIME-Version: 1.0 + Content-Transfer-Encoding: quoted-printable + Content-Type: text/plain; charset=UTF-8 + Subject: Nothing to see here. -Dieser Betreff enth=C3=A4lt auch einen Umlaut! -EOF + Dieser Betreff enth=C3=A4lt auch einen Umlaut! + EOF ' test_expect_success $PREREQ 'convert from quoted-printable to base64' ' @@ -1416,9 +1414,9 @@ EOF " test_expect_success $PREREQ 'setup expect' ' -cat >expected <expected <<-\EOF + Look, I have a CRLF and an =3D sign!=0D + EOF ' test_expect_success $PREREQ 'CRLF and sendemail.transferencoding=quoted-printable' ' @@ -1433,9 +1431,9 @@ test_expect_success $PREREQ 'CRLF and sendemail.transferencoding=quoted-printabl ' test_expect_success $PREREQ 'setup expect' ' -cat >expected <expected <<-\EOF + TG9vaywgSSBoYXZlIGEgQ1JMRiBhbmQgYW4gPSBzaWduIQ0K + EOF ' test_expect_success $PREREQ 'CRLF and sendemail.transferencoding=base64' ' -- cgit v1.2.1