summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-03-02 15:40:18 +0200
committerSergey Poznyakoff <gray@gnu.org>2019-03-02 16:08:43 +0200
commit4d422ec9bf22cb45785ed7a17a60d0d7b2bb013b (patch)
tree8121a557819cc66c07d3d03c7118547e1cd005ed
parent1ed195f6b39a8ded621ebb00b04b0418b8cc4e8f (diff)
downloadmailutils-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.am3
-rw-r--r--libproto/dotmail/tests/append.at43
-rw-r--r--libproto/dotmail/tests/attr.at13
-rw-r--r--libproto/dotmail/tests/body.at15
-rw-r--r--libproto/dotmail/tests/delete.at29
-rw-r--r--libproto/dotmail/tests/dm_mesg.c216
-rw-r--r--libproto/dotmail/tests/env.at11
-rw-r--r--libproto/dotmail/tests/header.at30
-rw-r--r--libproto/dotmail/tests/setattr.at138
-rw-r--r--libproto/dotmail/tests/testsuite.at17
-rw-r--r--libproto/dotmail/tests/uid.at16
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
70TESTSUITE = $(srcdir)/testsuite 71TESTSUITE = $(srcdir)/testsuite
71M4=m4 72M4=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
17DM_TEST([append], 17DM_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
22Date: Mon, 29 Jul 2002 22:00:04 +0100
23From: Alice <alice@wonder.land>
24Message-Id: <200207292200.3304@wonder.land>
25To: March Hare <hare@wonder.land>
26Subject: Re: Invitation
27Return-Path: alice@wonder.land
28
29Then it wasn't very civil of you to offer it
30])
31dm_mesg append msg 4 env_date env_sender body_text
32dm_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
68There isn't any 52There 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
59Date: Mon, 29 Jul 2002 22:00:04 +0100
60From: Alice <alice@wonder.land>
61Message-Id: <200207292200.3304@wonder.land>
62To: March Hare <hare@wonder.land>
63Subject: Re: Invitation
64Return-Path: alice@wonder.land
65
66Then it wasn't very civil of you to offer it
67])],
68[dm_mbox count],
69[# Append new message
70append msg
71# Select it
724
73# Check if it is scanned and loaded
74env_date
75env_sender
76body_text
77],
78
71[append: OK 79[append: OK
804 current message
724 env_date: Mon Jul 29 21:00:09 2002 814 env_date: Mon Jul 29 21:00:09 2002
734 env_sender: alice@wonder.land 824 env_sender: alice@wonder.land
744 body_text: Then it wasn't very civil of you to offer it 834 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
17DM_TEST([attr], 17DM_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
42I don't see any wine 41I don't see any wine
43. 42.
44], 43],
45[1 attr: - 44[],[],
45[1
46attr
472
48attr
49],
50[1 current message
511 attr: -
522 current message
462 attr: FOR 532 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
17DM_TEST([body], 17DM_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
44what I see"! 43what I see"!
45. 44.
46], 45],
47[1 body_lines: 2 46[],[],
47[1
48body_lines
49body_size
502
51body_lines
52body_size
53],
54[1 current message
551 body_lines: 2
481 body_size: 77 561 body_size: 77
572 current message
492 body_lines: 3 582 body_lines: 3
502 body_size: 118 592 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
17DM_TEST([delete], 17DM_MESG([delete],
18[dm_mesg 3 set_deleted expunge 3 body_text
19dm_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
67Then it wasn't very civil of you to offer it 64Then 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
693
70set_deleted
71# Expunge deleted messages
72expunge
73# Message 4 becomes 3 after expunge. Re-select it.
743
75# Display headers and body to check if it has been properly updated.
76headers
77body_text
78],
79[3 current message
803 set_deleted: OK
71expunge: OK 81expunge: OK
823 current message
833 headers: Received:(from alice@wonder.land) by wonder.land id 3304 for hare@wonder.land; Mon, 29 Jul 2002 22:00:09 +0100
84Date:Mon, 29 Jul 2002 22:00:04 +0100
85From:Alice <alice@wonder.land>
86Message-Id:<200207292200.3304@wonder.land>
87To:March Hare <hare@wonder.land>
88Subject:Re: Invitation
89Return-Path:alice@wonder.land
90
723 body_text: Then it wasn't very civil of you to offer it 913 body_text: Then it wasn't very civil of you to offer it
73 92
743 933
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
34void 34void
35