[PATCH 1/3] test: add known broken tests for from: and subject:

David Bremner david at tethera.net
Wed Aug 21 04:41:24 PDT 2019


Given we want 'a b' to parse as 'a AND b', then for any
probabilistic (free text) prefix foo:, we should also get 'foo:a
foo:b' expanding to 'foo:a AND foo:b'. Currently this is not true due
to the implimentation of regex fields.
---
 test/T760-implicit-operators.sh | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100755 test/T760-implicit-operators.sh

diff --git a/test/T760-implicit-operators.sh b/test/T760-implicit-operators.sh
new file mode 100755
index 00000000..b79673df
--- /dev/null
+++ b/test/T760-implicit-operators.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+test_description='implicit operators in query parser'
+. $(dirname "$0")/test-lib.sh || exit 1
+
+test_AND() {
+    add_message  "[$1]=a at b"
+    add_message  "[$1]=b at c"
+
+    test_begin_subtest "$1: implicitly joined by AND"
+    $2
+    notmuch count $1:a at b > OUTPUT
+    notmuch count $1:a $1:b >> OUTPUT
+    notmuch count $1:a at b OR $1:b at c >> OUTPUT
+    notmuch count $1:a at b $1:b at c >> OUTPUT
+    cat <<EOF > EXPECTED
+1
+1
+2
+0
+EOF
+    test_expect_equal_file EXPECTED OUTPUT
+}
+
+test_AND from test_subtest_known_broken
+test_AND subject test_subtest_known_broken
+test_AND to
+
+test_done
-- 
2.23.0.rc1



More information about the notmuch mailing list