]> git.notmuchmail.org Git - notmuch/blobdiff - test/T670-duplicate-mid.sh
test-lib.sh: add test_valid_json
[notmuch] / test / T670-duplicate-mid.sh
index 21a9689ab870a222bd80e6c54ba4fa4a8c62e1b3..4e5672abc4e880a1b6c536366d5936d03d7c373b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="duplicate message ids"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 add_message '[id]="duplicate"' '[subject]="message 1" [filename]=copy1'
 add_message '[id]="duplicate"' '[subject]="message 2" [filename]=copy2'
@@ -47,6 +47,16 @@ EOF
 notmuch search --output=files subject:'"message 2"' | notmuch_dir_sanitize > OUTPUT
 test_expect_equal_file EXPECTED OUTPUT
 
+test_begin_subtest 'Regexp search for second subject'
+test_subtest_known_broken
+cat <<EOF >EXPECTED
+MAIL_DIR/copy0
+MAIL_DIR/copy1
+MAIL_DIR/copy2
+EOF
+notmuch search --output=files 'subject:"/message 2/"' | notmuch_dir_sanitize > OUTPUT
+test_expect_equal_file EXPECTED OUTPUT
+
 add_message '[id]="duplicate"' '[body]="sekrit" [filename]=copy3'
 test_begin_subtest 'search for body in duplicate file'
 cat <<EOF >EXPECTED
@@ -78,6 +88,7 @@ output=$(notmuch show --body=false --format=json id:duplicate |
             notmuch_json_show_sanitize | sed 's/message [0-9]/A_SUBJECT/')
 expected='[[[{
     "id": "XXXXX",
+    "crypto": {},
     "match": true,
     "excluded": false,
     "filename": [