]> diplodocus.org Git - nmh/blobdiff - test/pick/test-pick
Update the mh-sequence(5) man page with details of the format of the
[nmh] / test / pick / test-pick
index 84eb18cde89aabb655e39a0b18d61eb344724ed9..e1434dcef5ef359cb767cb66490040bb6164540e 100755 (executable)
@@ -99,14 +99,12 @@ cat >"$expected" <<EOF
 EOF
 check "$expected" "$actual"
 
-if test -w /dev/tty && printf '' >/dev/tty; then
+if test -t 1  &&  (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
-else
-  echo "$0: skip tty test because can't write to /dev/tty"
 fi
 
 # Also, check that the exit status is 1.
@@ -244,5 +242,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" <<EOF
+From: Test13 <test13@example.com>
+To: Some User <user@example.com>
+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