diff options
Diffstat (limited to 'libmailutils/tests/fromflt.at')
-rw-r--r-- | libmailutils/tests/fromflt.at | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/libmailutils/tests/fromflt.at b/libmailutils/tests/fromflt.at new file mode 100644 index 000000000..a5b331375 --- /dev/null +++ b/libmailutils/tests/fromflt.at | |||
@@ -0,0 +1,96 @@ | |||
1 | # This file is part of GNU Mailutils. -*- Autotest -*- | ||
2 | # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | ||
3 | # | ||
4 | # GNU Mailutils is free software; you can redistribute it and/or | ||
5 | # modify it under the terms of the GNU General Public License as | ||
6 | # published by the Free Software Foundation; either version 3, or (at | ||
7 | # your option) any later version. | ||
8 | # | ||
9 | # This program is distributed in the hope that it will be useful, but | ||
10 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | # General Public License for more details. | ||
13 | # | ||
14 | # You should have received a copy of the GNU General Public License | ||
15 | # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. | ||
16 | # This file is part of Mailfromd testsuite. | ||
17 | |||
18 | # ------------------------------------------- | ||
19 | # Data for 'From' filter tests. | ||
20 | # ------------------------------------------- | ||
21 | |||
22 | m4_define([from_plain_text],[From this time on | ||
23 | from that source | ||
24 | From stdin | ||
25 | and | ||
26 | From them | ||
27 | ]) | ||
28 | |||
29 | m4_define([from_encoded_text],[>From this time on | ||
30 | from that source | ||
31 | From stdin | ||
32 | and | ||
33 | >From them | ||
34 | ]) | ||
35 | |||
36 | # ------------------------------------------- | ||
37 | # Test 'From' encoding | ||
38 | # ------------------------------------------- | ||
39 | |||
40 | # Test read mode | ||
41 | |||
42 | AT_SETUP([from filter encoding (read)]) | ||
43 | AT_KEYWORDS([from frome fromer encode]) | ||
44 | |||
45 | AT_CHECK([ | ||
46 | AT_DATA([input],from_plain_text) | ||
47 | fltst from encode read < input | ||
48 | ], | ||
49 | [0], | ||
50 | [from_encoded_text]) | ||
51 | |||
52 | AT_CLEANUP | ||
53 | |||
54 | # The same, in write mode | ||
55 | |||
56 | AT_SETUP([from filter encoding (write)]) | ||
57 | AT_KEYWORDS([from frome fromew encode]) | ||
58 | |||
59 | AT_CHECK([ | ||
60 | AT_DATA([input],from_plain_text) | ||
61 | fltst from encode write < input | ||
62 | ], | ||
63 | [0], | ||
64 | [from_encoded_text]) | ||
65 | |||
66 | AT_CLEANUP | ||
67 | |||
68 | # ------------------------------------------- | ||
69 | # Test '>From' decoding | ||
70 | # ------------------------------------------- | ||
71 | |||
72 | AT_SETUP([from filter decoding (read)]) | ||
73 | AT_KEYWORDS([from fromd fromdr decode]) | ||
74 | |||
75 | AT_CHECK([ | ||
76 | AT_DATA([input],from_encoded_text) | ||
77 | fltst from decode read < input | ||
78 | ], | ||
79 | [0], | ||
80 | [from_plain_text]) | ||
81 | |||
82 | AT_CLEANUP | ||
83 | |||
84 | # The same, in write mode | ||
85 | |||
86 | AT_SETUP([from filter decoding (write)]) | ||
87 | AT_KEYWORDS([from fromd fromdw decode]) | ||
88 | |||
89 | AT_CHECK([ | ||
90 | AT_DATA([input],from_encoded_text) | ||
91 | fltst from decode write < input | ||
92 | ], | ||
93 | [0], | ||
94 | [from_plain_text]) | ||
95 | |||
96 | AT_CLEANUP | ||