]>
diplodocus.org Git - nmh/blob - test/mhbuild/test-cte
2 #########################################################
4 # Test the use of explicit Content-Transfer-Encoding tags
6 #########################################################
8 if test -z "${MH_OBJ_DIR}"; then
9 srcdir
=`dirname "$0"`/..
/..
10 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
13 .
"$MH_OBJ_DIR/test/common.sh"
17 LC_ALL
=en_US.UTF-8
; export LC_ALL
19 draft
="$MH_TEST_DIR/$$.draft"
20 expected
="$MH_TEST_DIR/$$.expected"
23 # Force some text to be quoted-printable
27 To: Mr Test <mrtest@example.com>
32 This is a test of a message with a shørt line.
35 run_prog mhbuild
"$draft"
37 cat > "$expected" <<EOF
38 To: Mr Test <mrtest@example.com>
42 Content-Type: text/plain; charset="UTF-8"
43 Content-Transfer-Encoding: quoted-printable
45 This is a test of a message with a sh=C3=B8rt line.
49 # Force some text to be base64, to test out the encoder. Try at different
50 # line lengths to check out the padding on the routines to convert LF to
51 # CR LF. The current implementation reads in using a 3 byte buffer, so make
52 # sure we catch all of those cases.
56 To: Mr Test <mrtest@example.com>
61 This is a test of a message with a shørt line.
64 run_prog mhbuild
"$draft"
66 cat > "$expected" <<EOF
67 To: Mr Test <mrtest@example.com>
71 Content-Type: text/plain; charset="UTF-8"
72 Content-Transfer-Encoding: base64
74 VGhpcyBpcyBhIHRlc3Qgb2YgYSBtZXNzYWdlIHdpdGggYSBzaMO4cnQgbGluZS4NCg==
77 check
"$draft" "$expected"
80 To: Mr Test <mrtest@example.com>
85 This is a test of a mëssage with a shørt line.
88 run_prog mhbuild
"$draft"
90 cat > "$expected" <<EOF
91 To: Mr Test <mrtest@example.com>
95 Content-Type: text/plain; charset="UTF-8"
96 Content-Transfer-Encoding: base64
98 VGhpcyBpcyBhIHRlc3Qgb2YgYSBtw6tzc2FnZSB3aXRoIGEgc2jDuHJ0IGxpbmUuDQo=
101 check
"$draft" "$expected"
104 To: Mr Test <mrtest@example.com>
109 This is a test of a mëssäge with a shørt line.
112 run_prog mhbuild
"$draft"
114 cat > "$expected" <<EOF
115 To: Mr Test <mrtest@example.com>
119 Content-Type: text/plain; charset="UTF-8"
120 Content-Transfer-Encoding: base64
122 VGhpcyBpcyBhIHRlc3Qgb2YgYSBtw6tzc8OkZ2Ugd2l0aCBhIHNow7hydCBsaW5lLg0K
125 check
"$draft" "$expected"
128 To: Mr Test <mrtest@example.com>
133 This is a test of a message with a shørt line.
134 This is a second line.
137 run_prog mhbuild
"$draft"
139 cat > "$expected" <<EOF
140 To: Mr Test <mrtest@example.com>
144 Content-Type: text/plain; charset="UTF-8"
145 Content-Transfer-Encoding: base64
147 VGhpcyBpcyBhIHRlc3Qgb2YgYSBtZXNzYWdlIHdpdGggYSBzaMO4cnQgbGluZS4NClRoaXMgaXMg
148 YSBzZWNvbmQgbGluZS4NCg==
151 check
"$draft" "$expected"
154 To: Mr Test <mrtest@example.com>
159 This is a test of a mëssage with a shørt line.
160 This is a second line.
163 run_prog mhbuild
"$draft"
165 cat > "$expected" <<EOF
166 To: Mr Test <mrtest@example.com>
170 Content-Type: text/plain; charset="UTF-8"
171 Content-Transfer-Encoding: base64
173 VGhpcyBpcyBhIHRlc3Qgb2YgYSBtw6tzc2FnZSB3aXRoIGEgc2jDuHJ0IGxpbmUuDQpUaGlzIGlz
174 IGEgc2Vjb25kIGxpbmUuDQo=
177 check
"$draft" "$expected"
180 To: Mr Test <mrtest@example.com>
185 This is a test of a mëssäge with a shørt line.
186 This is a second line.
189 run_prog mhbuild
"$draft"
191 cat > "$expected" <<EOF
192 To: Mr Test <mrtest@example.com>
196 Content-Type: text/plain; charset="UTF-8"
197 Content-Transfer-Encoding: base64
199 VGhpcyBpcyBhIHRlc3Qgb2YgYSBtw6tzc8OkZ2Ugd2l0aCBhIHNow7hydCBsaW5lLg0KVGhpcyBp
200 cyBhIHNlY29uZCBsaW5lLg0K
203 check
"$draft" "$expected"