File: test-cte-binary

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 (54 lines) | stat: -rwxr-xr-x 1,206 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
54
#!/bin/sh
######################################################
#
# Test Content-Transfer-Encoding: binary (Debian #136976).
#
######################################################

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"

setup_test
expected=$MH_TEST_DIR/$$.expected
actual=$MH_TEST_DIR/$$.actual

# Write message with Content-Transfer-Encoding: binary text.
msgfile=`mhpath new`
msgnum=`basename $msgfile`
cat > $msgfile <<EOF
Content-Transfer-Encoding: binary
To: bar@example.edu
Content-Type: text/plain
Subject: test
From: foo@example.edu
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <20698507875204@example.com>
Date: Tue, 05 Mar 2002 19:20:35 +0100

This is a test; this is the body.
EOF

# check it
cat > $expected <<EOF
[ Message inbox:11 ]
Date:    Tue, 05 Mar 2002 19:20:35 +0100
To:      bar@example.edu
From:    foo@example.edu
Subject: test

MIME-Version: 1.0
Content-Disposition: inline

[ part  - text/plain -   34B  ]
This is a test; this is the body.
EOF
run_prog mhshow $msgnum > $actual 2>&1
check "$expected" "$actual" : C-T-E binary text

exit $failed