aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-01-21 19:38:49 -0400
committerDavid Bremner <david@tethera.net>2022-01-27 07:48:27 -0400
commit053a390370922a213b57f4f2e4bc2c5c8fb88c74 (patch)
treed37f2ec0770ba3e397b9421076fa4a68fe827c12 /test
parent0756105832612ad12661d1dd61b7e7b5bfe99c6c (diff)
test: known broken tests for trailing / in path search (infix)
In [1], David Edmondson observed that the trailing / added by many completion mechanisms causes path searches to silently fail. This test reproduces that bug for both `path:' and `folder:' searches. [1]: id:cunoasuolcv.fsf@gargravarr.hh.sledj.net
Diffstat (limited to 'test')
-rwxr-xr-xtest/T100-search-by-folder.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/T100-search-by-folder.sh b/test/T100-search-by-folder.sh
index fc9ad5f8..fbc68266 100755
--- a/test/T100-search-by-folder.sh
+++ b/test/T100-search-by-folder.sh
@@ -31,6 +31,12 @@ output=$(notmuch search --output=files folder:bad/news | notmuch_search_files_sa
test_expect_equal "$output" "MAIL_DIR/bad/news/msg-XXX
MAIL_DIR/duplicate/bad/news/msg-XXX"
+test_begin_subtest "Folder search with --output=files (trailing /)"
+test_subtest_known_broken
+output=$(notmuch search --output=files folder:bad/news/ | notmuch_search_files_sanitize)
+test_expect_equal "$output" "MAIL_DIR/bad/news/msg-XXX
+MAIL_DIR/duplicate/bad/news/msg-XXX"
+
test_begin_subtest "After removing duplicate instance of matching path"
rm -r "${MAIL_DIR}/bad/news"
notmuch new
@@ -120,6 +126,14 @@ test_expect_equal "$output" "MAIL_DIR/bar/17:2,
MAIL_DIR/bar/18:2,
MAIL_DIR/cur/51:2,"
+test_begin_subtest "path: search (trailing /)"
+test_subtest_known_broken
+output=$(notmuch search --output=files path:"bar/" | notmuch_search_files_sanitize | sort)
+# cur/51:2, is a duplicate of bar/18:2,
+test_expect_equal "$output" "MAIL_DIR/bar/17:2,
+MAIL_DIR/bar/18:2,
+MAIL_DIR/cur/51:2,"
+
test_begin_subtest "top level path: search"
output=$(notmuch search --output=files path:'""' | notmuch_search_files_sanitize | sort)
test_expect_equal "$output" "MAIL_DIR/01:2,