Fix: Ignore empty quoted strings when parsing string queries

Fixes #383.

Reported-by: Adam Porter <adam@alphapapa.net>
This commit is contained in:
Adam Porter 2023-12-16 03:57:35 -06:00
parent 5775848b8a
commit 7a6b622cd0
3 changed files with 26 additions and 3 deletions

View file

@ -648,6 +648,14 @@ with keyword arg NOW in PLIST."
;; TODO: Other predicates.
(it "Ignores empty quoted strings"
(expect (org-ql--query-string-to-sexp "\"\"")
:to-equal nil)
(expect (org-ql--query-string-to-sexp "foo \"\" bar")
:to-equal '(and (rifle "foo") (rifle "bar")))
(expect (org-ql--query-string-to-sexp "foo \"baz\" bar")
:to-equal '(and (rifle "foo") (rifle "baz") (rifle "bar"))))
(it "Negated terms"
(expect (org-ql--query-string-to-sexp "todo: !todo:CHECK,SOMEDAY")
:to-equal '(and (todo) (not (todo "CHECK" "SOMEDAY"))))