add a test to test-scan-multibyte
[mmh] / test / tests / scan / test-scan-multibyte
1 #!/bin/sh
2 #
3 # test scan(1) with multibytes
4
5 . $MH_TEST_COMMON
6
7 require_locale en_US.utf-8 en_US.utf8
8 LC_ALL=en_US.UTF-8
9 export LC_ALL
10
11
12 cat >"$MH_TEST_DIR/Mail/inbox/11" <<!
13 Mime-Version: 1.0
14 From: Bar <bar@example.org>
15 To: Baz <baz@example.org>
16 Subject: Subject Test Header
17  =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88?=
18  =?UTF-8?q?=E3=83=98=E3=83=BC=E3=83=87=E3=83=BC?=
19 Date: Mon, 15 May 2017 15:55:01 +0900
20 Content-Transfer-Encoding: quoted-printable
21 Content-Type: text/plain; charset=UTF-8
22 Message-Id: <20170515065506.03959103B49@example.org>
23
24 This is a test email
25
26 !
27
28 cat >"$MH_TEST_DIR/Mail/inbox/12" <<!
29 Subject: =?iso-8859-1?Q?Schl=FCssel?=
30 Mime-Version: 1.0
31 From: Bob <bob@example.org>
32 Date: Mon, 22 Sep 2014 01:17:05 +0200
33 Message-Id: <83C54147-7D2B-4B7F-9502-11C1EB9526BC@example.org>
34 To: Alice <alice@example.net>
35 Content-Transfer-Encoding: quoted-printable
36 Content-Type: text/plain;
37         charset=iso-8859-1
38
39 Hallo Alice,
40
41 hier ist dein Schl=FCssel, ich hoffe das Signieren hat funktioniert. =
42 Mein =F6ffentlicher Schl=FCssel liegt auf dem Keyserver.
43
44 Viele Gr=FC=DFe
45 Bob
46
47 !
48
49 runandcheck "scan 12 +inbox" <<!
50   12  2014-09-22 01:17  Bob                Schlüssel
51 !
52
53 runandcheck "scan 11-12 +inbox -width 80" <<!
54   11  2017-05-15 15:55  Bar                Subject Test Header テストヘー
55   12  2014-09-22 01:17  Bob                Schlüssel
56 !
57
58 runandcheck "scan 11-12 +inbox -width 49" <<!
59   11  2017-05-15 15:55  Bar                Subje
60   12  2014-09-22 01:17  Bob                Schlü
61 !
62
63 LC_ALL=C
64 unset MM_CHARSET
65 runandcheck "scan 12 +inbox" <<!
66   12  2014-09-22 01:17  Bob                Schl?ssel
67 !