This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The nmh Mail Handling System".
The branch, master has been updated via df31d2abe4d453eaef9a818a83bae42e80a1e67b (commit) via 2ff8ab0e9e57e7966e28ad9f68550e103b260980 (commit) from 9e1f6d6d4c2e154c7274e7fb3f1931924e458b17 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.savannah.gnu.org/cgit/nmh.git/commit/?id=df31d2abe4d453eaef9a818a83bae42e80a1e67b commit df31d2abe4d453eaef9a818a83bae42e80a1e67b Author: David Levine <levin...@acm.org> Date: Sun Feb 26 10:55:46 2012 -0600 Added test-pick. diff --git a/Makefile.am b/Makefile.am index 08fee7c..3f1650d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -49,7 +49,8 @@ TESTS = test/bad-input/test-header test/comp/test-comp-format \ test/manpages/test-manpages test/mhbuild/test-forw \ test/mhpath/test-mhpath \ test/mhshow/test-cte-binary test/mhshow/test-qp \ - test/mhshow/test-subpart test/new/test-basic test/pick/test-stderr \ + test/mhshow/test-subpart test/new/test-basic \ + test/pick/test-pick test/pick/test-stderr \ test/repl/test-if-str test/scan/test-scan \ test/sequences/test-flist test/sequences/test-mark \ test/whatnow/test-attach-detach test/whatnow/test-cd \ diff --git a/test/pick/test-pick b/test/pick/test-pick new file mode 100755 index 0000000..6ee4449 --- /dev/null +++ b/test/pick/test-pick @@ -0,0 +1,219 @@ +#!/bin/sh +###################################################### +# +# Test pick +# +###################################################### + +set -e + +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 + +# Add an 11th message. +sed \ + -e 's/10/11/g' \ + -e 's/^To:\(.*\)/To:\1\nCc: <anot...@example.com>/' \ + -e 's/^\(Date:.*\)2006\( 00:00:\)00/\12008\200\nDelivery-Date: \12009\241/' \ + $MH_TEST_DIR/Mail/inbox/10 >$MH_TEST_DIR/Mail/inbox/11 + +# Test message specification. +run_test 'pick first last' '1 +11' + +# Test -and. +run_test 'pick -subject message.3 -and -from Test3' '3' +run_test 'pick -subject message.3 -and -from Test4' \ + 'pick: no messages match specification +0' + +# Test -or. +run_test 'pick -subject message.3 -or -from Test3' '3' +run_test 'pick -subject message.3 -or -from Test4' '3 +4' + +# Test -not. +run_test 'pick -not -subject message.8 last:5' '7 +9 +10 +11' + +# Test -lbrace, -rbrace. +run_test 'pick -subject message.12 -and -subject message.3 -or -from Test4' '4' +run_test 'pick -subject message.12 -and -lbrace -subject message.3 -rbrace' \ + 'pick: no messages match specification +0' + +# -and takes precedence over -or. +run_test 'pick -subject message.12 -or -subject message.3 -and -from Test3' '3' +run_test 'pick -subject message.12 -or -subject message.3 -and -from Test4' \ + 'pick: no messages match specification +0' + +# -not takes precedence over -and. +run_test 'pick -not -subject message.12 -and -subject message.3' '3' +run_test 'pick -not -lbrace -subject NoMatch -and -subject message.3 -rbrace' \ + '1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11' + +# Test MHPDEBUG. +MHPDEBUG=1 pick -not -lbrace -subject NoMatch -and -subject message.3 -rbrace \ + >/dev/null 2>$actual +cat >$expected <<EOF +NOT +| AND +| | PATTERN(header) ^subject[ ]*:.*NoMatch +| | PATTERN(header) ^subject[ ]*:.*message.3 +EOF +check $expected $actual + + +# Produce 0 if no messages match and standard output is not a tty. +# Note that there is an error message on stderr, but it's redirected +# to /dev/null here. +echo `pick -subject message.3 -and -from Test4 >$actual 2>/dev/null` >/dev/null +cat >$expected <<EOF +0 +EOF +check $expected $actual + +# Produce no standard output if no messages match and standard output +# is a tty. To test that, move stderr to stdout. +echo `pick -subject message.3 -and -from Test4 >&2-` >$actual +cat >$expected <<EOF + +EOF +check $expected $actual + +# Also, check that the exit status is 1. +set +e +pick -subject message.3 -and -from Test4 2>/dev/null +run_test "echo $?" '1' +set -e + +# Test -cc. +run_test 'pick -cc another' '11' + +# Test -date. +run_test 'pick -date 29.Sep.2008' '11' + +# Test -from. +run_test 'pick -from test7' '7' + +# Test -search. +run_test 'pick -search This.is.message.number.[456]' '4 +5 +6' + +# Test -subject. +run_test 'pick -subject message.2' '2' + +# Test -to. +run_test 'pick -to some -nolist' '11 hits' +run_test 'pick -to u...@example.com -nolist' '11 hits' + +# Test -after. +pick -after '28 Sep 2008' >$actual 2>&1 +cat >$expected <<EOF +11 +EOF +check $expected $actual +# Invert exit status so execution doesn't terminate due to -e. +! pick -after '29 Sep 2008' >$actual 2>/dev/null +cat >$expected <<EOF +0 +EOF +check $expected $actual + +# Test -before. While -after doesn't include the specified date, -before does. +pick -before '29 Sep 2008' last:3 >$actual 2>&1 +cat >$expected <<EOF +9 +10 +11 +EOF +check $expected $actual +pick -before '28 Sep 2008' last:3 >$actual 2>&1 +cat >$expected <<EOF +9 +10 +EOF +check $expected $actual +# Invert exit status so execution doesn't terminate due to -e. +! pick -before '28 Sep 2006' last:3 >$actual 2>/dev/null +cat >$expected <<EOF +0 +EOF +check $expected $actual + +# Test -datefield. +# Invert exit status so execution doesn't terminate due to -e. +! pick -datefield date -after '29 Sep 2008 00:00:00' >$actual 2>/dev/null +cat >$expected <<EOF +0 +EOF +check $expected $actual +pick -datefield delivery-date -after '29 Sep 2008 00:00:00' >$actual 2>&1 +cat >$expected <<EOF +11 +EOF +check $expected $actual + +# Test sequence creation. +run_test 'pick 2 4 6 8 10 -sequence even' '5 hits' +run_test 'mark -s even -list' 'even: 2 4 6 8 10' + +# Test private sequence creation. +# Set current message for following tests. +folder +inbox 1 > /dev/null +run_test 'pick -date 29.Sep.2008 -sequence privateseq -nopublic' '1 hit' +run_test 'mark -list' 'cur: 1 +even: 2 4 6 8 10 +privateseq (private): 11' + +# Test add to private sequence. +run_test 'pick first -sequence privateseq -nozero -nopublic' '1 hit' +run_test 'mark -list' 'cur: 1 +even: 2 4 6 8 10 +privateseq (private): 1 11' + +# Test sequence creation, with -list. +run_test 'pick 5 7 -sequence odd -list' '5 +7' +run_test 'mark -s odd -list' 'odd: 5 7' + +# Test sequence creation, with default of -zero. +run_test 'pick 1 3 -sequence odd' '2 hits' +run_test 'mark -s odd -list' 'odd: 1 3' + +# Test sequence creation, with -nozero. +run_test 'pick 5 7 9 -sequence odd -nozero' '3 hits' +run_test 'mark -s odd -list' 'odd: 1 3 5 7 9' + +# Test sequence creation, with explicit folder, -public, and -zero. +run_test 'pick +inbox 5 7 9 11 -public -sequence odd' '4 hits' +run_test 'mark -s odd -list' 'odd: 5 7 9 11' + +# Test -nolist. +run_test 'pick all -nolist' '11 hits' + + +exit $failed http://git.savannah.gnu.org/cgit/nmh.git/commit/?id=2ff8ab0e9e57e7966e28ad9f68550e103b260980 commit 2ff8ab0e9e57e7966e28ad9f68550e103b260980 Author: David Levine <levin...@acm.org> Date: Sun Feb 26 10:32:29 2012 -0600 Suppress echoing of man page build lines. One of them says "warning", and it's handy to check that build output doesn't say that. diff --git a/Makefile.am b/Makefile.am index c8b7587..08fee7c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -479,41 +479,41 @@ manext8 = 8 $(man_MANS): man/man.sed man/man.sed: Makefile - echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@ - echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@ - echo 's,%nmhdate%,$(DATE),g' >> $@ - echo 's,%bindir%,$(bindir),g' >> $@ - echo 's,%etcdir%,$(sysconfdir),g' >> $@ - echo 's,%libdir%,$(libdir),g' >> $@ - echo 's,%mandir%,$(mandir),g' >> $@ - echo 's,%mailspool%,$(mailspool),g' >> $@ - echo 's,%sendmailpath%,$(sendmailpath),g' >> $@ - echo 's,%default_editor%,$(editorpath),g' >> $@ - echo 's,%default_pager%,$(pagerpath),g' >> $@ - echo 's,%manext1%,$(manext1),g' >> $@ - echo 's,%manext5%,$(manext5),g' >> $@ - echo 's,%manext8%,$(manext8),g' >> $@ - echo '/%components%/r $(top_srcdir)/etc/components' >> $@ - echo ' s,%components%,,g' >> $@ - echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@ - echo ' s,%distcomps%,,g' >> $@ - echo '/%forwcomps%/r $(top_srcdir)/etc/forwcomps' >> $@ - echo ' s,%forwcomps%,,g' >> $@ - echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@ - echo ' s,%mhl_forward%,,g' >> $@ - echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@ - echo ' s,%mhl_format%,,g' >> $@ - echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@ - echo ' s,%mhl_reply%,,g' >> $@ + @echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@ + @echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@ + @echo 's,%nmhdate%,$(DATE),g' >> $@ + @echo 's,%bindir%,$(bindir),g' >> $@ + @echo 's,%etcdir%,$(sysconfdir),g' >> $@ + @echo 's,%libdir%,$(libdir),g' >> $@ + @echo 's,%mandir%,$(mandir),g' >> $@ + @echo 's,%mailspool%,$(mailspool),g' >> $@ + @echo 's,%sendmailpath%,$(sendmailpath),g' >> $@ + @echo 's,%default_editor%,$(editorpath),g' >> $@ + @echo 's,%default_pager%,$(pagerpath),g' >> $@ + @echo 's,%manext1%,$(manext1),g' >> $@ + @echo 's,%manext5%,$(manext5),g' >> $@ + @echo 's,%manext8%,$(manext8),g' >> $@ + @echo '/%components%/r $(top_srcdir)/etc/components' >> $@ + @echo ' s,%components%,,g' >> $@ + @echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@ + @echo ' s,%distcomps%,,g' >> $@ + @echo '/%forwcomps%/r $(top_srcdir)/etc/forwcomps' >> $@ + @echo ' s,%forwcomps%,,g' >> $@ + @echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@ + @echo ' s,%mhl_forward%,,g' >> $@ + @echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@ + @echo ' s,%mhl_format%,,g' >> $@ + @echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@ + @echo ' s,%mhl_reply%,,g' >> $@ .man.$(manext1): - $(SED) -f man/man.sed $< > $@ + @$(SED) -f man/man.sed $< > $@ .man.$(manext5): - $(SED) -f man/man.sed $< > $@ + @$(SED) -f man/man.sed $< > $@ .man.$(manext8): - $(SED) -f man/man.sed $< > $@ + @$(SED) -f man/man.sed $< > $@ ## Don't include commit hashes in ChangeLog. ChangeLog: ----------------------------------------------------------------------- Summary of changes: Makefile.am | 61 +++++++------- test/pick/test-pick | 219 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 250 insertions(+), 30 deletions(-) create mode 100755 test/pick/test-pick hooks/post-receive -- The nmh Mail Handling System _______________________________________________ Nmh-commits mailing list Nmh-commits@nongnu.org https://lists.nongnu.org/mailman/listinfo/nmh-commits