unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 3e13f5453c6f87a0a62b1e03f4333a451a30a83a 1387 bytes (raw)
name: emacs/notmuch-expr-test.el 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
 
(require 'ert)
(require 'notmuch-expr)

(ert-deftest and ()
  (should
    (equal
      "(\"valued\" AND is:unread AND from:spam@example.com)"
      (notmuch-expr
       '(and
         "valued"
         (is "unread")
         (from "spam@example.com"))))))

(ert-deftest body ()
  (should
   (equal
    "(body:wallace AND from:gromit)"
    (notmuch-expr
     '(and
       (body "wallace")
       (from "gromit"))))))

(ert-deftest regex ()
  (should
   (equal
    "(subject:\"/Ca+sh/\" AND NOT is:important)"
    (notmuch-expr
     '(and
       (subject "/Ca+sh/")
       (not (is "important")))))))

(ert-deftest precedence ()
  (should
   (equal
    "(to:emacs-devel AND (NOT is:spam OR is:important))"
    (notmuch-expr
     '(and
       (to "emacs-devel")
       (or
         (not (is "spam"))
         (is "important")))))))

(ert-deftest xor ()
  (should
   (equal
    "is:inbox XOR is:sent"
    (notmuch-expr
     '(xor
       (is "inbox")
       (is "sent"))))))

(ert-deftest literal ()
  (should
   (equal
    "(is:inbox OR from:foo)"
    (notmuch-expr
     '(or
       (is "inbox")
       (literal "from:foo"))))))

(ert-deftest string ()
  (should
   (equal
    "(is:inbox OR \"from:foo\")"
    (notmuch-expr
     '(or
       (is "inbox")
       "from:foo")))))

(ert-deftest tag-with-spaces ()
  (should
   (equal
    "is:\"a tag\""
    (notmuch-expr
     '(tag "a tag")))))

debug log:

solving 3e13f545 ...
found 3e13f545 in https://yhetil.org/notmuch/20200513100024.8474-1-tom@tom-fitzhenry.me.uk/

applying [1/1] https://yhetil.org/notmuch/20200513100024.8474-1-tom@tom-fitzhenry.me.uk/
diff --git a/emacs/notmuch-expr-test.el b/emacs/notmuch-expr-test.el
new file mode 100644
index 00000000..3e13f545

Checking patch emacs/notmuch-expr-test.el...
Applied patch emacs/notmuch-expr-test.el cleanly.

index at:
100644 3e13f5453c6f87a0a62b1e03f4333a451a30a83a	emacs/notmuch-expr-test.el

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).