From 913292787b938ca699a657a825916d343a3ba07b Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 11 Aug 2019 11:36:37 -0500 Subject: [PATCH] Tests: Query functions/macros Test a few basic forms of these to ensure, e.g. that arguments don't get broken. --- tests/test-org-ql.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 4875897..287c7bd 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -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")))