]> diplodocus.org Git - nmh/blob - test/mhshow/test-markers
Fixed mhshow part markers when displaying multiple messages.
[nmh] / test / mhshow / test-markers
1 #!/bin/sh
2 ######################################################
3 #
4 # Test mhshow part markers
5 #
6 ######################################################
7
8 if test -z "${MH_OBJ_DIR}"; then
9 srcdir=`dirname "$0"`/../..
10 MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
11 fi
12
13 . "$MH_OBJ_DIR/test/common.sh"
14
15 setup_test
16 expected=$MH_TEST_DIR/$$.expected
17 actual=$MH_TEST_DIR/$$.actual
18
19 start_test
20
21 # check markers when showing multiple messages
22 start_test "makers when showing multiple messages"
23 cat >"$expected" <<EOF
24 [ part 1 - text/plain - 30B ]
25 first message, part 1 content
26 [ part 2 - text/plain - first message, part 2 C-D 30B ]
27 first message, part 2 content
28 [ part 1 - text/plain - 31B ]
29 second message, part 1 content
30 EOF
31
32 cat >"`mhpath new`" <<EOF
33 Content-Type: multipart/mixed;boundary="_boundary_"
34 MIME-Version: 1.0
35
36 --_boundary_
37 Content-Type: text/plain
38
39 first message, part 1 content
40
41 --_boundary_
42 Content-Type: text/plain
43 Content-Description: first message, part 2 C-D
44
45 first message, part 2 content
46
47 --_boundary_--
48 EOF
49
50 cat >"`mhpath new`" <<EOF
51 Content-Type: multipart/mixed;boundary="_boundary_"
52 MIME-Version: 1.0
53
54 --_boundary_
55 Content-Type: text/plain
56
57 second message, part 1 content
58
59 --_boundary_--
60 EOF
61
62 run_prog mhshow -noheader -form mhl.null -concat last:2 > "$actual"
63 check "$expected" "$actual"
64
65
66 finish_test
67 exit $failed