nmh-workers
[Top] [All Lists]

[Nmh-workers] [PATCH] test of scan with Local-Mailbox demonstrating bug

2015-01-29 18:51:05
Bug is when Local-Mailbox is a substring of a From address, scan (and repl)
think it's a message from yourself.

Anyone know how to fix it? :)

Thanks.

---
 Makefile.am                       |  2 +-
 test/scan/test-scan-local-mailbox | 41 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100755 test/scan/test-scan-local-mailbox

diff --git a/Makefile.am b/Makefile.am
index af4a2fe..7b65106 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -92,7 +92,7 @@ TESTS = test/ali/test-ali test/anno/test-anno \
        test/rcv/test-rcvtty test/refile/test-refile \
        test/repl/test-if-str test/repl/test-trailing-newline \
        test/repl/test-multicomp test/repl/test-repl \
-       test/scan/test-scan test/scan/test-scan-multibyte \
+       test/scan/test-scan test/scan/test-scan-alternate-mailboxes 
test/scan/test-scan-multibyte \
        test/sequences/test-flist test/sequences/test-mark \
        test/sequences/test-out-of-range \
        test/slocal/test-slocal \
diff --git a/test/scan/test-scan-local-mailbox 
b/test/scan/test-scan-local-mailbox
new file mode 100755
index 0000000..0fbc89a
--- /dev/null
+++ b/test/scan/test-scan-local-mailbox
@@ -0,0 +1,41 @@
+#!/bin/sh
+######################################################
+#
+# Test scan with Local-Mailbox set.
+#
+######################################################
+
+if test -z "${MH_OBJ_DIR}"; then
+    srcdir=`dirname "$0"`/../..
+    MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
+fi
+
+. "$MH_OBJ_DIR/test/common.sh"
+
+setup_test
+
+# est1(_at_)example(_dot_)com is a substring of test1(_at_)example(_dot_)com; 
the latter
+# should not be considered a match for the former (causing 'To:Some
+# User' to be printed instead of 'Test1').
+echo 'Local-Mailbox: est1(_at_)example(_dot_)com' >> "$MH"
+
+expected="$MH_TEST_DIR/$$.expected"
+actual="$MH_TEST_DIR/$$.actual"
+
+cat >"$expected" <<EOF
+   1  09/29 Test1              Testing message 1<<This is message number 1 >>
+   2  09/29 Test2              Testing message 2<<This is message number 2 >>
+   3  09/29 Test3              Testing message 3<<This is message number 3 >>
+   4  09/29 Test4              Testing message 4<<This is message number 4 >>
+   5  09/29 Test5              Testing message 5<<This is message number 5 >>
+   6  09/29 Test6              Testing message 6<<This is message number 6 >>
+   7  09/29 Test7              Testing message 7<<This is message number 7 >>
+   8  09/29 Test8              Testing message 8<<This is message number 8 >>
+   9  09/29 Test9              Testing message 9<<This is message number 9 >>
+  10  09/29 Test10             Testing message 10<<This is message number 10 >>
+EOF
+
+run_prog scan +inbox -width 80 >"$actual" || exit 1
+check "$expected" "$actual"
+
+exit $failed
-- 
2.2.0.rc0.207.ga3a616c

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>