summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2021-01-12 13:17:12 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2021-01-12 13:17:12 (GMT)
commit000c989d079613acbca5986bbc0ff8a1e896245c (patch) (side-by-side diff)
treef2733c47d1bc9f6ec85dd911d6d1369464c9ec26
parent3a3e90a04e457a57144c666bc5be23733a7aab39 (diff)
downloadmailutils-000c989d079613acbca5986bbc0ff8a1e896245c.tar.gz
mailutils-000c989d079613acbca5986bbc0ff8a1e896245c.tar.bz2
Fix libmu_scm testsuite
This is a follow-up to a3bd653315. * libmu_scm/tests/testsuite.at (MU_GUILE_OUTPUT_FILTER): New macro. (MU_GUILE_CHECK): If MU_GUILE_OUTPUT_FILTER is not empty, filter the stdout through it. * libmu_scm/tests/mailbox-append-message.at: Filter out line and byte counts. * libmu_scm/tests/mailbox-expunge.at: Fix line and byte counts. * libmu_scm/tests/mailbox-get-message.at: Likewise. * libmu_scm/tests/mailbox-iterate.at: Likewise.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libmu_scm/tests/mailbox-append-message.at24
-rw-r--r--libmu_scm/tests/mailbox-expunge.at16
-rw-r--r--libmu_scm/tests/mailbox-get-message.at8
-rw-r--r--libmu_scm/tests/mailbox-iterate.at8
-rw-r--r--libmu_scm/tests/testsuite.at4
5 files changed, 37 insertions, 23 deletions
diff --git a/libmu_scm/tests/mailbox-append-message.at b/libmu_scm/tests/mailbox-append-message.at
index 6951873..f87b6ee 100644
--- a/libmu_scm/tests/mailbox-append-message.at
+++ b/libmu_scm/tests/mailbox-append-message.at
@@ -6,6 +6,16 @@
AT_SETUP([mu-mailbox-append-message])
AT_KEYWORDS([mailbox])
+
+dnl Initial mailbox is modified after append (uidvalidity and uid values
+dnl added). Since the exact number of bytes added to each message cannot
+dnl be reliably predicted, we remove the line and byte count from comparison.
+dnl Additionally, the newly added X-UID header is also removed.
+m4_pushdef([MU_GUILE_OUTPUT_FILTER],
+[sed -e '/#<message/s/ [0-9][0-9]* [0-9][0-9]*>/>/' \
+ -e /^X-UID:/d
+])
+
WITH_MAILBOX([spool/mbox1],
[MU_GUILE_CHECK([
(use-modules ((ice-9 binary-ports)))
@@ -22,12 +32,12 @@ WITH_MAILBOX([spool/mbox1],
(put-u8 (current-output-port) c))
(close port)))],
0,
-[#<message "foobar@nonexistent.net" "Fri Dec 28 22:18" 44 1254>
-#<message "bar@dontmailme.org" "Fri Dec 28 23:28" 13 534>
-#<message "gray@example.net" "Sat Jul 13 00:43" 42 1569>
-#<message "gray@example.net" "Sat Jul 13 00:50" 84 3399>
-#<message "gray@example.net" "Sat Jul 13 00:43" 27 857>
-#<message "user@example.org" "Fri Jun 8 14:30" 10 539>
+[#<message "foobar@nonexistent.net" "Fri Dec 28 22:18">
+#<message "bar@dontmailme.org" "Fri Dec 28 23:28">
+#<message "gray@example.net" "Sat Jul 13 00:43">
+#<message "gray@example.net" "Sat Jul 13 00:50">
+#<message "gray@example.net" "Sat Jul 13 00:43">
+#<message "user@example.org" "Fri Jun 8 14:30">
From: user@example.org
To: someone@example.com
Subject: De omnibus rebus et quibusdam aliis
@@ -38,9 +48,11 @@ quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
])])
AT_CLEANUP
+m4_popdef([MU_GUILE_OUTPUT_FILTER])
dnl depends on:
dnl message-print.at
dnl message-port-read-2.at
diff --git a/libmu_scm/tests/mailbox-expunge.at b/libmu_scm/tests/mailbox-expunge.at
index ebab567..f075852 100644
--- a/libmu_scm/tests/mailbox-expunge.at
+++ b/libmu_scm/tests/mailbox-expunge.at
@@ -22,15 +22,15 @@ WITH_MAILBOX([spool/mbox2],
(display "; Revisited\n")
(mailbox-list mbox))],
0,
-[#<message "foobar@nonexistent.net" "Fri Dec 28 22:18" 47 1297>
-#<message "bar@dontmailme.org" "Fri Dec 28 23:28" 15 552>
-#<message "gray@example.net" "Sat Jul 13 00:50" 86 3417>
-#<message "gray@example.net" "Sat Jul 13 00:43" 29 875>
+[#<message "foobar@nonexistent.net" "Fri Dec 28 22:18" 48 1298>
+#<message "bar@dontmailme.org" "Fri Dec 28 23:28" 16 553>
+#<message "gray@example.net" "Sat Jul 13 00:50" 87 3418>
+#<message "gray@example.net" "Sat Jul 13 00:43" 30 876>
; Revisited
-#<message "foobar@nonexistent.net" "Fri Dec 28 22:18" 47 1297>
-#<message "bar@dontmailme.org" "Fri Dec 28 23:28" 15 552>
-#<message "gray@example.net" "Sat Jul 13 00:50" 86 3417>
-#<message "gray@example.net" "Sat Jul 13 00:43" 29 875>
+#<message "foobar@nonexistent.net" "Fri Dec 28 22:18" 48 1298>
+#<message "bar@dontmailme.org" "Fri Dec 28 23:28" 16 553>
+#<message "gray@example.net" "Sat Jul 13 00:50" 87 3418>
+#<message "gray@example.net" "Sat Jul 13 00:43" 30 876>
])])
AT_CLEANUP
diff --git a/libmu_scm/tests/mailbox-get-message.at b/libmu_scm/tests/mailbox-get-message.at
index 4cb5625..a8264e8 100644
--- a/libmu_scm/tests/mailbox-get-message.at
+++ b/libmu_scm/tests/mailbox-get-message.at
@@ -15,10 +15,10 @@ WITH_MAILBOX([spool/mbox1],
(let ((msg (mu-mailbox-get-message mbox i)))
(display msg)(newline)))))],
0,
-[#<message "foobar@nonexistent.net" "Fri Dec 28 22:18" 44 1254>
-#<message "bar@dontmailme.org" "Fri Dec 28 23:28" 13 534>
-#<message "gray@example.net" "Sat Jul 13 00:43" 42 1569>
-#<message "gray@example.net" "Sat Jul 13 00:50" 84 3399>
+[#<message "foobar@nonexistent.net" "Fri Dec 28 22:18" 45 1255>
+#<message "bar@dontmailme.org" "Fri Dec 28 23:28" 14 535>
+#<message "gray@example.net" "Sat Jul 13 00:43" 43 1570>
+#<message "gray@example.net" "Sat Jul 13 00:50" 85 3400>
#<message "gray@example.net" "Sat Jul 13 00:43" 27 857>
])])
AT_CLEANUP
diff --git a/libmu_scm/tests/mailbox-iterate.at b/libmu_scm/tests/mailbox-iterate.at
index 15a9fe4..aefe3be 100644
--- a/libmu_scm/tests/mailbox-iterate.at
+++ b/libmu_scm/tests/mailbox-iterate.at
@@ -13,10 +13,10 @@ WITH_MAILBOX([spool/mbox1],
((not (mu-mailbox-more-messages? mbox)))
(display msg)(newline)))],
0,
-[#<message "foobar@nonexistent.net" "Fri Dec 28 22:18" 44 1254>
-#<message "bar@dontmailme.org" "Fri Dec 28 23:28" 13 534>
-#<message "gray@example.net" "Sat Jul 13 00:43" 42 1569>
-#<message "gray@example.net" "Sat Jul 13 00:50" 84 3399>
+[#<message "foobar@nonexistent.net" "Fri Dec 28 22:18" 45 1255>
+#<message "bar@dontmailme.org" "Fri Dec 28 23:28" 14 535>
+#<message "gray@example.net" "Sat Jul 13 00:43" 43 1570>
+#<message "gray@example.net" "Sat Jul 13 00:50" 85 3400>
#<message "gray@example.net" "Sat Jul 13 00:43" 27 857>
])])
AT_CLEANUP
diff --git a/libmu_scm/tests/testsuite.at b/libmu_scm/tests/testsuite.at
index cafba6b..7876c71 100644
--- a/libmu_scm/tests/testsuite.at
+++ b/libmu_scm/tests/testsuite.at
@@ -7,6 +7,7 @@
m4_include([testsuite.inc])
m4_pushdef([MU_TEST_MAILBOX])
+m4_pushdef([MU_GUILE_OUTPUT_FILTER])
# MU_GUILE_CHECK([CODE],
# [STATUS=0],[STDOUT],[STDERR],[RUN-IF-FAIL],[RUN-IF-PASS])
@@ -18,7 +19,7 @@ m4_define([MU_GUILE_CHECK],
[$1]
])
m4_if(MU_TEST_MAILBOX,,,[MUT_MBCOPY($abs_top_srcdir/testsuite/MU_TEST_MAILBOX,mbox)])
-AT_CHECK([TZ=0 guile -q --no-auto-compile -L $LIBMU_SCM_ROOT -L $LIBMU_SCM_SRCDIR -s input.scm 2>err
+AT_CHECK([TZ=0 guile -q --no-auto-compile -L $LIBMU_SCM_ROOT -L $LIBMU_SCM_SRCDIR -s input.scm 2>err m4_if(MU_GUILE_OUTPUT_FILTER,,,[|MU_GUILE_OUTPUT_FILTER])
rc=$?
grep -v '^;;;' err>&2
exit $rc],m4_shift($@))])
@@ -89,3 +90,4 @@ m4_include([mime-add-part.at])
#
m4_popdef([MU_TEST_MAILBOX])
+m4_popdef([MU_GUILE_OUTPUT_FILTER])

Return to:

Send suggestions and report system problems to the System administrator.