From 3d6747f427615d9615e72fd856bdcf597936defd Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 5 Jul 2021 02:29:45 -0500 Subject: [PATCH] WIP: Parse string into ts Rather than using a Unix timestamp, which makes a different ts depending on the system timezone, due to an issue in ts.el (which I hope to fix soon). --- tests/test-org-ql-ert.el | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/tests/test-org-ql-ert.el b/tests/test-org-ql-ert.el index e3d3d68..230d901 100644 --- a/tests/test-org-ql-ert.el +++ b/tests/test-org-ql-ert.el @@ -41,25 +41,11 @@ ;;;; Functions -(let ((print-level nil) - (print-length nil)) - (ert-deftest org-ql--normalize-query () - (should (equal (org-ql--normalize-query '(or (ts-active :on "2019-01-01") - (ts-a :on "2019-01-01") - (ts-inactive :on "2019-01-01") - (ts-i :on "2019-01-01"))) - `(or (ts :type active - :from ,(make-ts :unix 1546322400.0) - :to ,(make-ts :unix 1546408799.0)) - (ts :type active - :from ,(make-ts :unix 1546322400.0) - :to ,(make-ts :unix 1546408799.0)) - (ts :type inactive - :from ,(make-ts :unix 1546322400.0) - :to ,(make-ts :unix 1546408799.0)) - (ts :type inactive - :from ,(make-ts :unix 1546322400.0) - :to ,(make-ts :unix 1546408799.0))))))) +(ert-deftest org-ql--normalize-query () + (should (equal (org-ql--normalize-query '(ts-active :on "2019-01-01")) + `(ts :type active + :from ,(ts-apply :hour 0 :minute 0 :second 0 (ts-parse "2019-01-01")) + :to ,(ts-apply :hour 23 :minute 59 :second 59 (ts-parse "2019-01-01")))))) ;;;; Footer