[PATCH 5/6] WIP/test: (count ...) tests

Subject: [PATCH 5/6] WIP/test: (count ...) tests

Date: Sat, 18 Feb 2023 13:17:36 -0400

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


The most interesting case is probably tags with a small number of
uses, since these could be typos or similar errors.
---
 test/T083-sexpr-count.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/T083-sexpr-count.sh b/test/T083-sexpr-count.sh
index 858aa8bf..1be3f62d 100755
--- a/test/T083-sexpr-count.sh
+++ b/test/T083-sexpr-count.sh
@@ -133,4 +133,12 @@ id:87iqd9rn3l.fsf@vertex.dottedmag
 EOF
 test_expect_equal_file EXPECTED OUTPUT
 
+test_begin_subtest "messages with tags used by 4 messages"
+output=$(notmuch count --output=messages --query=sexp '(tag (count 4))')
+test_expect_equal "${output}" "4"
+
+test_begin_subtest "no tag is used less than 4 times"
+output=$(notmuch count --output=messages --query=sexp '(tag (count * 3))')
+test_expect_equal "${output}" "0"
+
 test_done
-- 
2.39.1

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: