]>
Commit | Line | Data |
---|---|---|
4839c0b5 JH |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2005 Junio C Hamano | |
4 | # | |
5 | ||
5be60078 | 6 | test_description='git mailinfo and git mailsplit test' |
4839c0b5 JH |
7 | |
8 | . ./test-lib.sh | |
9 | ||
10 | test_expect_success 'split sample box' \ | |
5be60078 | 11 | 'git mailsplit -o. ../t5100/sample.mbox >last && |
4839c0b5 JH |
12 | last=`cat last` && |
13 | echo total is $last && | |
87f1b884 | 14 | test `cat last` = 9' |
4839c0b5 JH |
15 | |
16 | for mail in `echo 00*` | |
17 | do | |
18 | test_expect_success "mailinfo $mail" \ | |
5be60078 | 19 | "git mailinfo -u msg$mail patch$mail <$mail >info$mail && |
4839c0b5 JH |
20 | echo msg && |
21 | diff ../t5100/msg$mail msg$mail && | |
22 | echo patch && | |
23 | diff ../t5100/patch$mail patch$mail && | |
24 | echo info && | |
25 | diff ../t5100/info$mail info$mail" | |
26 | done | |
27 | ||
cce8d6fd JS |
28 | test_expect_success 'respect NULs' ' |
29 | ||
b2a42f55 JH |
30 | git mailsplit -d3 -o. ../t5100/nul-plain && |
31 | cmp ../t5100/nul-plain 001 && | |
cce8d6fd JS |
32 | (cat 001 | git mailinfo msg patch) && |
33 | test 4 = $(wc -l < patch) | |
34 | ||
35 | ' | |
36 | ||
9aa23094 JH |
37 | test_expect_success 'Preserve NULs out of MIME encoded message' ' |
38 | ||
39 | git mailsplit -d5 -o. ../t5100/nul-b64.in && | |
40 | cmp ../t5100/nul-b64.in 00001 && | |
41 | git mailinfo msg patch <00001 && | |
42 | cmp ../t5100/nul-b64.expect patch | |
43 | ||
44 | ' | |
45 | ||
4839c0b5 | 46 | test_done |