summaryrefslogtreecommitdiffstats
path: root/test/mail.test
blob: 2bbee7dd242baef7b9ce82bf6f56d65b7c8150e1 (plain) (blame)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
	$ rm -rf d
	$ mkdir -p d/patches
	$ cd d

	$ cat > no-subject
	< Here goes a longer description of the patch, which is
	< totally useless except as a test case for the quilt mail
	< command. This paragraph is longer than 150 characters so
	< that it won't be taken for a subject header itself.
	<
	< Index: anything

	$ cat no-subject > patches/1.diff
	$ ls patches/ > series
	$ quilt mail --mbox mbox --prefix "test" --sender user@domain.name --subject "This is a test" -m "Message"
	> Unable to extract a subject header from patches/1.diff

	$ cat - no-subject > patches/1.diff
	< Subject: Subject of 1.diff
	<
	< Acked-by: Dummy <dummy@some.where>
	<

	$ quilt mail --mbox mbox --prefix "test" --sender user@domain.name -m "Message"
	> Introduction has no subject header

	$ cat - no-subject > patches/2.diff
	< DESC
	< Subject of 2.diff
	< is: split
	< into multiple
	< lines
	< EDESC
	<
	< Signed-off-by: Dummy <dummy@some.where>
	<

	$ cat - no-subject > patches/3.diff
	< Subject of 3.diff
	<
	< To: Dummy <dummy@some.where>
	<

	$ cat - no-subject > patches/4.diff
	< First paragraph used as
	< subject of 4.diff.
	<
	< Cc: Dummy <dummy@some.where>
	<

	$ cat - no-subject > patches/5.diff
	< Subject of 1.diff
	<

	$ ls patches/ > series
	$ quilt mail --mbox mbox --prefix "test" --sender user@domain.name --subject "This is a test" -m "Message"
	> Patches 1.diff, 5.diff have duplicate subject headers.

	$ cat - no-subject > patches/5.diff
	< Aw: [patch] Fwd: Re: [patch 5/7] Fw: Subject of 5.diff
	<

	$ quilt mail --mbox mbox --prefix "test" --sender user@domain.name --subject "This is a test" -m "Message"
	$ grep -e '^Subject:' -e '^To:' -e '^Cc:' -e '^--$' mbox
	> Subject: [test 0/5] This is a test
	> --
	> Cc: Dummy <dummy@some.where>
	> Subject: [test 1/5] Subject of 1.diff
	> --
	> Cc: Dummy <dummy@some.where>
	> Subject: [test 2/5] Subject of 2.diff is: split into multiple lines
	> --
	> To: Dummy <dummy@some.where>
	> Subject: [test 3/5] Subject of 3.diff
	> To: Dummy <dummy@some.where>
	> --
	> Cc: Dummy <dummy@some.where>
	> Subject: [test 4/5] First paragraph used as subject of 4.diff.
	> Cc: Dummy <dummy@some.where>
	> --
	> Subject: [test 5/5] Subject of 5.diff
	> --

	$ cd ..
	$ rm -rf d