diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-03-02 15:40:18 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-03-02 16:08:43 +0200 |
commit | 4d422ec9bf22cb45785ed7a17a60d0d7b2bb013b (patch) | |
tree | 8121a557819cc66c07d3d03c7118547e1cd005ed | |
parent | 1ed195f6b39a8ded621ebb00b04b0418b8cc4e8f (diff) | |
download | mailutils-4d422ec9bf22cb45785ed7a17a60d0d7b2bb013b.tar.gz mailutils-4d422ec9bf22cb45785ed7a17a60d0d7b2bb013b.tar.bz2 |
Improve the dotmail testsuite
* libproto/dotmail/tests/dm_mesg.c: Rewrite to take commands from stdin.
* libproto/dotmail/tests/Makefile.am: Add setattr.at
* libproto/dotmail/tests/testsuite.at (DM_MESG): New macro.
* libproto/dotmail/tests/setattr.at: New file.
* libproto/dotmail/tests/append.at: Use DM_MESG.
* libproto/dotmail/tests/attr.at: Likewise.
* libproto/dotmail/tests/body.at: Likewise.
* libproto/dotmail/tests/delete.at: Likewise.
* libproto/dotmail/tests/env.at: Likewise.
* libproto/dotmail/tests/header.at: Likewise.
* libproto/dotmail/tests/uid.at: Likewise.
-rw-r--r-- | libproto/dotmail/tests/Makefile.am | 3 | ||||
-rw-r--r-- | libproto/dotmail/tests/append.at | 43 | ||||
-rw-r--r-- | libproto/dotmail/tests/attr.at | 13 | ||||
-rw-r--r-- | libproto/dotmail/tests/body.at | 15 | ||||
-rw-r--r-- | libproto/dotmail/tests/delete.at | 29 | ||||
-rw-r--r-- | libproto/dotmail/tests/dm_mesg.c | 216 | ||||
-rw-r--r-- | libproto/dotmail/tests/env.at | 11 | ||||
-rw-r--r-- | libproto/dotmail/tests/header.at | 30 | ||||
-rw-r--r-- | libproto/dotmail/tests/setattr.at | 138 | ||||
-rw-r--r-- | libproto/dotmail/tests/testsuite.at | 17 | ||||
-rw-r--r-- | libproto/dotmail/tests/uid.at | 16 |
11 files changed, 387 insertions, 144 deletions
diff --git a/libproto/dotmail/tests/Makefile.am b/libproto/dotmail/tests/Makefile.am index a033346e7..8139e51b4 100644 --- a/libproto/dotmail/tests/Makefile.am +++ b/libproto/dotmail/tests/Makefile.am | |||
@@ -65,7 +65,8 @@ TESTSUITE_AT = \ | |||
65 | uid.at\ | 65 | uid.at\ |
66 | qget.at\ | 66 | qget.at\ |
67 | append.at\ | 67 | append.at\ |
68 | delete.at | 68 | delete.at\ |
69 | setattr.at | ||
69 | 70 | ||
70 | TESTSUITE = $(srcdir)/testsuite | 71 | TESTSUITE = $(srcdir)/testsuite |
71 | M4=m4 | 72 | M4=m4 |
diff --git a/libproto/dotmail/tests/append.at b/libproto/dotmail/tests/append.at index 141643019..a474edf61 100644 --- a/libproto/dotmail/tests/append.at +++ b/libproto/dotmail/tests/append.at | |||
@@ -14,23 +14,7 @@ | |||
14 | # You should have received a copy of the GNU Lesser General Public License | 14 | # You should have received a copy of the GNU Lesser General Public License |
15 | # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | DM_TEST([append], | 17 | DM_MESG([append], |
18 | [AT_DATA([msg], | ||
19 | [Received: (from alice@wonder.land) | ||
20 | by wonder.land id 3304 | ||
21 | for hare@wonder.land; Mon, 29 Jul 2002 22:00:09 +0100 | ||
22 | Date: Mon, 29 Jul 2002 22:00:04 +0100 | ||
23 | From: Alice <alice@wonder.land> | ||
24 | Message-Id: <200207292200.3304@wonder.land> | ||
25 | To: March Hare <hare@wonder.land> | ||
26 | Subject: Re: Invitation | ||
27 | Return-Path: alice@wonder.land | ||
28 | |||
29 | Then it wasn't very civil of you to offer it | ||
30 | ]) | ||
31 | dm_mesg append msg 4 env_date env_sender body_text | ||
32 | dm_mbox count | ||
33 | ], | ||
34 | [Received: (from hare@wonder.land) | 18 | [Received: (from hare@wonder.land) |
35 | by wonder.land id 3301 | 19 | by wonder.land id 3301 |
36 | for alice@wonder.land; Mon, 29 Jul 2002 22:00:06 +0100 | 20 | for alice@wonder.land; Mon, 29 Jul 2002 22:00:06 +0100 |
@@ -68,7 +52,32 @@ Return-Path: hare@wonder.land | |||
68 | There isn't any | 52 | There isn't any |
69 | . | 53 | . |
70 | ], | 54 | ], |
55 | [AT_DATA([msg], | ||
56 | [Received: (from alice@wonder.land) | ||
57 | by wonder.land id 3304 | ||
58 | for hare@wonder.land; Mon, 29 Jul 2002 22:00:09 +0100 | ||
59 | Date: Mon, 29 Jul 2002 22:00:04 +0100 | ||
60 | From: Alice <alice@wonder.land> | ||
61 | Message-Id: <200207292200.3304@wonder.land> | ||
62 | To: March Hare <hare@wonder.land> | ||
63 | Subject: Re: Invitation | ||
64 | Return-Path: alice@wonder.land | ||
65 | |||
66 | Then it wasn't very civil of you to offer it | ||
67 | ])], | ||
68 | [dm_mbox count], | ||
69 | [# Append new message | ||
70 | append msg | ||
71 | # Select it | ||
72 | 4 | ||
73 | # Check if it is scanned and loaded | ||
74 | env_date | ||
75 | env_sender | ||
76 | body_text | ||
77 | ], | ||
78 | |||
71 | [append: OK | 79 | [append: OK |
80 | 4 current message | ||
72 | 4 env_date: Mon Jul 29 21:00:09 2002 | 81 | 4 env_date: Mon Jul 29 21:00:09 2002 |
73 | 4 env_sender: alice@wonder.land | 82 | 4 env_sender: alice@wonder.land |
74 | 4 body_text: Then it wasn't very civil of you to offer it | 83 | 4 body_text: Then it wasn't very civil of you to offer it |
diff --git a/libproto/dotmail/tests/attr.at b/libproto/dotmail/tests/attr.at index 0439dcb1b..11694e5fb 100644 --- a/libproto/dotmail/tests/attr.at +++ b/libproto/dotmail/tests/attr.at | |||
@@ -14,8 +14,7 @@ | |||
14 | # You should have received a copy of the GNU Lesser General Public License | 14 | # You should have received a copy of the GNU Lesser General Public License |
15 | # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | DM_TEST([attr], | 17 | DM_MESG([attr], |
18 | [dm_mesg 1 attr 2 attr], | ||
19 | [Received: (from hare@wonder.land) | 18 | [Received: (from hare@wonder.land) |
20 | by wonder.land id 3301 | 19 | by wonder.land id 3301 |
21 | for alice@wonder.land; Mon, 29 Jul 2002 22:00:06 +0100 | 20 | for alice@wonder.land; Mon, 29 Jul 2002 22:00:06 +0100 |
@@ -42,6 +41,14 @@ Return-Path: alice@wonder.land | |||
42 | I don't see any wine | 41 | I don't see any wine |
43 | . | 42 | . |
44 | ], | 43 | ], |
45 | [1 attr: - | 44 | [],[], |
45 | [1 | ||
46 | attr | ||
47 | 2 | ||
48 | attr | ||
49 | ], | ||
50 | [1 current message | ||
51 | 1 attr: - | ||
52 | 2 current message | ||
46 | 2 attr: FOR | 53 | 2 attr: FOR |
47 | ]) | 54 | ]) |
diff --git a/libproto/dotmail/tests/body.at b/libproto/dotmail/tests/body.at index f0c383640..cb16cac02 100644 --- a/libproto/dotmail/tests/body.at +++ b/libproto/dotmail/tests/body.at | |||
@@ -14,8 +14,7 @@ | |||
14 | # You should have received a copy of the GNU Lesser General Public License | 14 | # You should have received a copy of the GNU Lesser General Public License |
15 | # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | DM_TEST([body], | 17 | DM_MESG([body], |
18 | [dm_mesg 1 body_lines body_size 2 body_lines body_size], | ||
19 | [Received: (from alice@wonder.land) | 18 | [Received: (from alice@wonder.land) |
20 | by wonder.land id 3314 | 19 | by wonder.land id 3314 |
21 | for hare@wonder.land; Mon, 29 Jul 2002 22:00:19 +0100 | 20 | for hare@wonder.land; Mon, 29 Jul 2002 22:00:19 +0100 |
@@ -44,8 +43,18 @@ as well say that "I see what I eat" is the same thing as "I eat | |||
44 | what I see"! | 43 | what I see"! |
45 | . | 44 | . |
46 | ], | 45 | ], |
47 | [1 body_lines: 2 | 46 | [],[], |
47 | [1 | ||
48 | body_lines | ||
49 | body_size | ||
50 | 2 | ||
51 | body_lines | ||
52 | body_size | ||
53 | ], | ||
54 | [1 current message | ||
55 | 1 body_lines: 2 | ||
48 | 1 body_size: 77 | 56 | 1 body_size: 77 |
57 | 2 current message | ||
49 | 2 body_lines: 3 | 58 | 2 body_lines: 3 |
50 | 2 body_size: 118 | 59 | 2 body_size: 118 |
51 | ]) | 60 | ]) |
diff --git a/libproto/dotmail/tests/delete.at b/libproto/dotmail/tests/delete.at index b97d3f0c6..212be15c5 100644 --- a/libproto/dotmail/tests/delete.at +++ b/libproto/dotmail/tests/delete.at | |||
@@ -14,10 +14,7 @@ | |||
14 | # You should have received a copy of the GNU Lesser General Public License | 14 | # You should have received a copy of the GNU Lesser General Public License |
15 | # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | DM_TEST([delete], | 17 | DM_MESG([delete], |
18 | [dm_mesg 3 set_deleted expunge 3 body_text | ||
19 | dm_mbox count | ||
20 | ], | ||
21 | [Received: (from hare@wonder.land) | 18 | [Received: (from hare@wonder.land) |
22 | by wonder.land id 3301 | 19 | by wonder.land id 3301 |
23 | for alice@wonder.land; Mon, 29 Jul 2002 22:00:06 +0100 | 20 | for alice@wonder.land; Mon, 29 Jul 2002 22:00:06 +0100 |
@@ -67,8 +64,30 @@ Return-Path: alice@wonder.land | |||
67 | Then it wasn't very civil of you to offer it | 64 | Then it wasn't very civil of you to offer it |
68 | . | 65 | . |
69 | ], | 66 | ], |
70 | [3 set_deleted: OK | 67 | [],[dm_mbox count], |
68 | [# Mark third message as deleted | ||
69 | 3 | ||
70 | set_deleted | ||
71 | # Expunge deleted messages | ||
72 | expunge | ||
73 | # Message 4 becomes 3 after expunge. Re-select it. | ||
74 | 3 | ||
75 | # Display headers and body to check if it has been properly updated. | ||
76 | headers | ||
77 | body_text | ||
78 | ], | ||
79 | [3 current message | ||
80 | 3 set_deleted: OK | ||
71 | expunge: OK | 81 | expunge: OK |
82 | 3 current message | ||
83 | 3 headers: Received:(from alice@wonder.land) by wonder.land id 3304 for hare@wonder.land; Mon, 29 Jul 2002 22:00:09 +0100 | ||
84 | Date:Mon, 29 Jul 2002 22:00:04 +0100 | ||
85 | From:Alice <alice@wonder.land> | ||
86 | Message-Id:<200207292200.3304@wonder.land> | ||
87 | To:March Hare <hare@wonder.land> | ||
88 | Subject:Re: Invitation | ||
89 | Return-Path:alice@wonder.land | ||
90 | |||
72 | 3 body_text: Then it wasn't very civil of you to offer it | 91 | 3 body_text: Then it wasn't very civil of you to offer it |
73 | 92 | ||
74 | 3 | 93 | 3 |
diff --git a/libproto/dotmail/tests/dm_mesg.c b/libproto/dotmail/tests/dm_mesg.c index 6dbda92c7..bc868a39a 100644 --- a/libproto/dotmail/tests/dm_mesg.c +++ b/libproto/dotmail/tests/dm_mesg.c | |||
@@ -32,7 +32,7 @@ get_num (char const *s) | |||
32 | } | 32 | } |
33 | 33 | ||
34 | void | 34 | void |
35 |