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:
parent
b5f9087e58
commit
913292787b
1 changed files with 19 additions and 0 deletions
|
|
@ -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)
|
(cl-loop while (re-search-forward org-heading-regexp nil t)
|
||||||
sum 1)))))
|
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"
|
(it "Query pre-processing"
|
||||||
(expect (org-ql--pre-process-query '(and "string1" "string2"))
|
(expect (org-ql--pre-process-query '(and "string1" "string2"))
|
||||||
:to-equal '(and (regexp "string1") (regexp "string2")))
|
:to-equal '(and (regexp "string1") (regexp "string2")))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue