Tests: Query functions/macros

Test a few basic forms of these to ensure, e.g. that arguments don't
get broken.
This commit is contained in:
Adam Porter 2019-08-11 11:36:37 -05:00
parent b5f9087e58
commit 913292787b

View file

@ -131,6 +131,25 @@ RESULTS should be a list of strings as returned by
(cl-loop while (re-search-forward org-heading-regexp nil t)
sum 1)))))
(describe "Query functions/macros"
(it "org-ql"
(expect (length (org-ql test-buffer
(category)
:sort deadline))
:to-equal num-headings))
(it "org-ql-select"
(expect (length (org-ql-select test-buffer
'(category)
:sort 'deadline))
:to-equal num-headings))
(it "org-ql-query"
(expect (length (org-ql-query :select 'element
:from test-buffer
:where '(category)
:order-by 'date))
:to-equal num-headings)))
(it "Query pre-processing"
(expect (org-ql--pre-process-query '(and "string1" "string2"))
:to-equal '(and (regexp "string1") (regexp "string2")))