File: test-format

package info (click to toggle)
nmh 1.8-4
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 7,860 kB
  • sloc: ansic: 50,445; sh: 22,697; makefile: 1,138; lex: 740; perl: 509; yacc: 265
file content (53 lines) | stat: -rwxr-xr-x 1,486 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
#
# Test mhl.headers, at least.

set -e

if test -z "${MH_OBJ_DIR}"; then
    srcdir=`dirname "$0"`/../..
    MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
fi

. "$MH_OBJ_DIR/test/common.sh"

require_locale $en_locales

setup_test
mhl="${MH_LIBEXEC_DIR}/mhl"
expected="$MH_TEST_DIR/$$.expected"
actual="$MH_TEST_DIR/$$.actual"

# check decode of To: and Cc:
start_test "decode of To: and Cc:"
cat >"$expected" <<EOF
Resent-To: Encoded ! <encoded_exclamation@example.com>
Resent-cc: Encoded , <encoded_comma@example.com>
Resent-From: Encoded . <encoded_period@example.com>
Date:    Sat, 13 Jul 2019 16:02:39
To:      Encoded + <encoded_plus@example.com>,
	 Encoded # <encoded_hash@example.com>
cc:      Encoded - <encoded_minus@example.com>
From:    Encoded * <encoded_asterisk@example.com>
Subject: encoded addresses


EOF

cat >"`mhpath new`" <<EOF
Resent-To: "Encoded =?utf-8?Q?=21?=" <encoded_exclamation@example.com>
Resent-cc: "Encoded =?utf-8?Q?=2c?=" <encoded_comma@example.com>
Resent-From: "Encoded =?utf-8?Q?=2e?=" <encoded_period@example.com>
To: "Encoded =?utf-8?Q?=2b?=" <encoded_plus@example.com>,
    "Encoded =?utf-8?Q?=23?=" <encoded_hash@example.com>
Cc: "Encoded =?utf-8?Q?=2d?=" <encoded_minus@example.com>
From: "Encoded =?utf-8?Q?=2a?=" <encoded_asterisk@example.com>
Date: Sat, 13 Jul 2019 16:02:39
Subject: encoded addresses
EOF

"$mhl" -nomoreproc -form mhl.headers `mhpath last` >"$actual"
check "$expected" "$actual"

finish_test
exit $failed