X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test%2Ftest-lib.el;h=c840bc98b0597e781a08dcfa45fe0f428385cdba;hb=dc8262bd336f1c406e5705ec8cb5029f1bacd524;hp=32d53736482493f3cf336c187b0990cd97d57223;hpb=17bfc25bb35dc8d1d6686298c6f842a3ce450940;p=notmuch diff --git a/test/test-lib.el b/test/test-lib.el index 32d53736..c840bc98 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -159,6 +159,21 @@ running, quit if it terminated." (lambda (x) `(prog1 ,x (notmuch-post-command))) body))) +;; For testing functions in +;; notmuch-{search,tree,unsorted}-result-format +(defun notmuch-test-result-flags (format-string result) + (let ((tags-to-letters (quote (("attachment" . "&") + ("signed" . "=") + ("unread" . "u") + ("inbox" . "i")))) + (tags (plist-get result :tags))) + (format format-string + (mapconcat (lambda (t2l) + (if (member (car t2l) tags) + (cdr t2l) + " ")) + tags-to-letters "")))) + ;; For historical reasons, we hide deleted tags by default in the test ;; suite (setq notmuch-tag-deleted-formats