nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] [PATCH] Test that show always shows message numbers.

2015-02-06 11:40:39
eric wrote:
show shows message numbers in two different formats when showing one
non-MIME, multiple non-MIME messages, or one MIME message.

show does not show any message numbers when showing multiple messages
any of which is MIME.

This is not a new bug, just one that has bothered me since I started
using mhshow with 1.6.

mhl shows message numbers.  mhshow doesn't.  show invokes mhshow if
any messages are mime.

so to fix this implies adding message number output to mhshow.

rather than hard-coding show's message number format logic (i.e., ">>>
folder:msg" vs.  "Message:  folder:msg", based on criteria i don't
completely understand), i think it would make sense to augment
mhshow's marker format to allow it to emit a message number.

i'll take a look at doing that.

paul

---
 Makefile.am         |   1 +
 test/show/test-show | 130 
++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 131 insertions(+)
 create mode 100755 test/show/test-show

diff --git a/Makefile.am b/Makefile.am
index af4a2fe..dabee88 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -95,6 +95,7 @@ TESTS = test/ali/test-ali test/anno/test-anno \
     test/scan/test-scan test/scan/test-scan-multibyte \
     test/sequences/test-flist test/sequences/test-mark \
     test/sequences/test-out-of-range \
+    test/show/test-show \
     test/slocal/test-slocal \
     test/whatnow/test-attach-detach test/whatnow/test-cd \
     test/whatnow/test-ls test/whom/test-whom \
diff --git a/test/show/test-show b/test/show/test-show
new file mode 100755
index 0000000..f83c1ea
--- /dev/null
+++ b/test/show/test-show
@@ -0,0 +1,130 @@
+#!/bin/sh
+
+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
+
+expected=$MH_TEST_DIR/$$.expected
+actual=$MH_TEST_DIR/$$.actual
+
+# Write message with a text/plain subpart.
+msgfile=`mhpath new`
+msgnum=`basename $msgfile`
+cat > $msgfile <<EOF
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="NextPart_001"
+Content-class: urn:content-classes:message
+Date: Thu, 19 May 2011 00:00:00 -0000
+From: sender(_at_)example(_dot_)com
+To: recipient(_at_)example(_dot_)com
+
+This is a multi-part message in MIME format.
+
+--NextPart_001
+Content-Type: multipart/related;
+    type="multipart/alternative";
+    boundary="NextPart_002"
+
+--NextPart_002
+Content-Type: text/plain;
+    charset="utf-8"
+
+This is the text/plain part.
+
+--NextPart_002--
+
+--NextPart_001--
+EOF
+
+# Test showing multiple non-MIME messages shows message numbers.
+
+cat > $expected <<EOF
+>>> inbox:1
+
+
+Date:    Fri, 29 Sep 2006 00:00:00
+To:      Some User <user(_at_)example(_dot_)com>
+From:    Test1 <test1(_at_)example(_dot_)com>
+Subject: Testing message 1
+
+
+This is message number 1
+
+
+
+>>> inbox:2
+
+
+Date:    Fri, 29 Sep 2006 00:00:00
+To:      Some User <user(_at_)example(_dot_)com>
+From:    Test2 <test2(_at_)example(_dot_)com>
+Subject: Testing message 2
+
+
+This is message number 2
+EOF
+
+show +inbox 1 2 > $actual || exit 1
+
+check "$expected" "$actual"
+
+# Test showing one MIME message shows message number.
+# Format is different; why?
+
+cat > $expected <<EOF
+(Message inbox:$msgnum)
+Date:    Thu, 19 May 2011 00:00:00 -0000
+To:      recipient(_at_)example(_dot_)com
+From:    sender(_at_)example(_dot_)com
+
+MIME-Version: 1.0
+Content-class: urn:content-classes:message
+
+[ part 1.1 - text/plain -   29B  ]
+This is the text/plain part.
+EOF
+
+show +inbox $msgnum > $actual || exit 1
+
+check "$expected" "$actual"
+
+# Test showing multiple MIME messages shows message numbers.
+# Currently fails.
+
+cat > $expected <<EOF
+>>> inbox:1
+
+
+Date:    Fri, 29 Sep 2006 00:00:00
+To:      Some User <user(_at_)example(_dot_)com>
+From:    Test1 <test1(_at_)example(_dot_)com>
+Subject: Testing message 1
+
+
+[ part  - text/plain -   25B  ]
+This is message number 1
+
+>>> inbox:$msgnum
+
+
+Date:    Thu, 19 May 2011 00:00:00 -0000
+To:      recipient(_at_)example(_dot_)com
+From:    sender(_at_)example(_dot_)com
+
+MIME-Version: 1.0
+Content-class: urn:content-classes:message
+
+[ part 1.1 - text/plain -   29B  ]
+This is the text/plain part.
+EOF
+
+show +inbox 1 $msgnum > $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

=----------------------
 paul fox, pgf(_at_)foxharp(_dot_)boston(_dot_)ma(_dot_)us (arlington, ma, 
where it's 16.3 degrees)

_______________________________________________
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>