Add heading-regexp predicate. Fix #64

This commit is contained in:
Feng Shu 2019-12-08 13:25:58 +08:00
parent b9dfd7d93b
commit 486778e9fa
3 changed files with 48 additions and 12 deletions

View file

@ -513,6 +513,16 @@ RESULTS should be a list of strings as returned by
(org-ql-expect ((heading "Take over" "world"))
'("Take over the world"))))
(describe "(heading-regexp)"
(org-ql-it "with one argument"
(org-ql-expect ((heading-regexp "w[ol]r[lm]d"))
;; NOTE: This--correctly--does not match the "Skype with president of
;; Antarctica" heading, which has the tag ":world:" in its heading line.
'("Take over the world")))
(org-ql-it "with two arguments"
(org-ql-expect ((heading-regexp "Take over" "w[ol]r[lm]d"))
'("Take over the world"))))
(describe "(outline-path)"
(org-ql-it "with one argument"
(org-ql-expect ((outline-path "symphony"))