X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/706236baa4c4670b5a074092dec5dec63ff50663..d231c858d574d37b6cc3d3cef82b06cb04f13b81:/test/pick/test-pick diff --git a/test/pick/test-pick b/test/pick/test-pick index 84eb18cd..1c365de4 100755 --- a/test/pick/test-pick +++ b/test/pick/test-pick @@ -99,14 +99,14 @@ cat >"$expected" </dev/tty; then - # Produce no standard output if no messages match and standard - # output is a tty. To test that even when run with stdout - # detached, write directly to /dev/tty. Can't capture the - # output so hopefully the user will notice it. - pick -subject message.3 -and -from Test4 >/dev/tty 2>/dev/null -else - echo "$0: skip tty test because can't write to /dev/tty" +if test -w /dev/tty; then + if printf '' >/dev/tty 2>/dev/null; then + # Produce no standard output if no messages match and standard + # output is a tty. To test that even when run with stdout + # detached, write directly to /dev/tty. Can't capture the + # output so hopefully the user will notice it. + pick -subject message.3 -and -from Test4 >/dev/tty 2>/dev/null + fi fi # Also, check that the exit status is 1. @@ -244,5 +244,31 @@ echo 12 >"$expected" pick -subject 'multi-line header field' 12 >"$actual" 2>&1 check "$expected" "$actual" +# Test MIME-encoded header. +cat >"$MH_TEST_DIR/Mail/inbox/13" < +To: Some User +Date: Fri, 29 Sep 2006 00:00:00 +Message-Id: 13@test.nmh +Subject: =?us-ascii?q?=66=6f=6f?= + =?utf-8?q?=62=61=72?= + +This is message number 13, with MIME-encoded Subject "foobar". +EOF + +echo 13 >"$expected" + +set +e +LC_CTYPE=en_US.UTF-8 pick -subject foobar 13 >"$actual" 2>&1 +set -e +check "$expected" "$actual" + +# Test -nosequence. +run_test 'pick +inbox 5 7 9 11 -sequence test -nosequence' '5 +7 +9 +11' +run_test 'mark -list -sequence test' 'test: ' + exit $failed