Testcase for decoding rfc 2047 strings.
Showing
1 changed file
with
49 additions
and
0 deletions
mailbox/testsuite/mailbox/rfc2047.exp
0 → 100644
1 | # -*- tcl -*- | ||
2 | # This file is part of Mailutils testsuite. | ||
3 | # Copyright (C) 2003, Free Software Foundation | ||
4 | # | ||
5 | # This program is free software; you can redistribute it and/or modify | ||
6 | # it under the terms of the GNU General Public License as published by | ||
7 | # the Free Software Foundation; either version 2 of the License, or | ||
8 | # (at your option) any later version. | ||
9 | # | ||
10 | # This program is distributed in the hope that it will be useful, | ||
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | # GNU General Public License for more details. | ||
14 | # | ||
15 | # You should have received a copy of the GNU General Public License | ||
16 | # along with this program; if not, write to the Free Software Foundation, | ||
17 | # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
18 | |||
19 | mailbox_run ${top_builddir}/examples/decode2047 -p | ||
20 | |||
21 | set chan [open ${srcdir}/RFC2047 r] | ||
22 | |||
23 | set command "" | ||
24 | for {gets $chan line} {![eof $chan]} {gets $chan line} { | ||
25 | switch -regexp -- "$line" { | ||
26 | "^#.*" { } | ||
27 | "^[^ \t].*=>.*" { | ||
28 | regexp "(.*)=>.*" $line dummy command | ||
29 | set pattern [list $line] | ||
30 | } | ||
31 | "^\$" { | ||
32 | if {$command != ""} { | ||
33 | verbose "COMMAND $command" | ||
34 | verbose "PATTERN $pattern" | ||
35 | mailbox_test -pattern $pattern $command | ||
36 | set command "" | ||
37 | } | ||
38 | } | ||
39 | default { | ||
40 | if [info exist pattern] { | ||
41 | set pattern [concat $pattern [list $line]] | ||
42 | } | ||
43 | } | ||
44 | } | ||
45 | } | ||
46 | |||
47 | close $chan | ||
48 | |||
49 | # end of address.exp |
-
Please register or sign in to post a comment