pick matching rework
[mmh] / test / tests / pick / test-search
diff --git a/test/tests/pick/test-search b/test/tests/pick/test-search
new file mode 100644 (file)
index 0000000..5fc6ca5
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+######################################################
+#
+# Test pick -search switch
+#
+######################################################
+
+. "$MH_TEST_COMMON"
+
+# Test MIME-encoded header.
+cat > $(mhpath b) <<!
+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: fooo
+
+This is a test message
+!
+lm=$(pick l)
+
+runandcheck 'pick -search fooo' <<! 2>/dev/null
+pick: no messages match specification
+0
+!
+
+cat > $(mhpath b) <<!
+From: Test13 <test13@example.com>
+To: Some User <user@example.com>
+Date: Fri, 29 Sep 2006 00:00:00
+Subject: bla
+
+This is a test message, with fooo in the body.
+!
+lm=$(pick l)
+
+runandcheck 'pick -search fooo' <<!
+$lm
+!