diff --git a/local/lib/org-x/test/dag/weekly.org b/local/lib/org-x/test/dag/weekly.org index f051785..f373b98 100644 --- a/local/lib/org-x/test/dag/weekly.org +++ b/local/lib/org-x/test/dag/weekly.org @@ -11,11 +11,15 @@ SCHEDULED: <2022-06-06 Mon> :PROPERTIES: :ID: 6b53ee41-b467-4bfb-a580-6218a3c78068 :END: -***** TODO be social +***** DONE be social +CLOSED: [2022-08-07 Sun 23:28] :PROPERTIES: :ID: f02504bd-45f8-4da6-936e-1b15e043f3d4 :CREATED: [2022-06-07 Tue 22:50] :END: +:LOGGING: +- State "DONE" from "TODO" [2022-08-07 Sun 23:28] +:END: **** TODO Tuesday SCHEDULED: <2022-06-07 Tue> :PROPERTIES: @@ -41,11 +45,15 @@ SCHEDULED: <2022-06-10 Fri> :PROPERTIES: :ID: 1d926eef-94c9-4b57-8cb0-225a308711e9 :END: -***** TODO learn to gamble +***** CANC learn to gamble +CLOSED: [2022-08-07 Sun 23:28] :PROPERTIES: :ID: ab077745-4041-458f-90ec-02aaecb2729d :CREATED: [2022-06-07 Tue 22:51] :END: +:LOGGING: +- State "CANC" from "TODO" [2022-08-07 Sun 23:28] +:END: **** TODO Saturday SCHEDULED: <2022-06-11 Sat> :PROPERTIES: diff --git a/local/lib/org-x/test/org-x-dag-test.el b/local/lib/org-x/test/org-x-dag-test.el index 0236de4..d1d870c 100644 --- a/local/lib/org-x/test/org-x-dag-test.el +++ b/local/lib/org-x/test/org-x-dag-test.el @@ -210,6 +210,34 @@ (cons nil m) (cons t (format "Expected '%s' not to be the indicated action" test-expr)))))) +(buttercup-define-matcher :id-to-be-qtp (to-test status deadline date) + (cl-destructuring-bind + ((test-expr . test) (_ . s) (_ . d) (_ . D)) + (->> (list to-test status deadline date) + (-map #'buttercup--expr-and-value)) + (let* ((local-eq-funs (list :deadline #'element-equal-p :date #'eq)) + (abs-date (org-x-dag-date-to-absolute D)) + (data (list :deadline d :date abs-date)) + (f (->> (-partial #'status-diff-msg local-eq-funs test-expr s nil data) + (-partial #'buffer-status-diff-msg test-expr :quarterly) + (-partial #'right-diff-msg test-expr)))) + (-if-let (m (funcall f (org-x-dag-id->bs test))) + (cons nil m) + (cons t (format "Expected '%s' not to be the indicated action" test-expr)))))) + +;; (buttercup-define-matcher :id-to-be-wkp (to-test status subtype date) +;; (cl-destructuring-bind +;; ((test-expr . test) (_ . s) (_ . y) (_ . d)) +;; (->> (list to-test status subtype date) +;; (-map #'buttercup--expr-and-value)) +;; (let* ((abs-date (org-x-dag-date-to-absolute d)) +;; (f (->> (-partial #'status-diff-msg nil test-expr y `(,s) abs-date) +;; (-partial #'buffer-status-diff-msg test-expr :weekly) +;; (-partial #'right-diff-msg test-expr)))) +;; (-if-let (m (funcall f (org-x-dag-id->bs test))) +;; (cons nil m) +;; (cons t (format "Expected '%s' not to be the indicated action" test-expr)))))) + ;; (buttercup-define-matcher :to-have-same-as-plist (a b) ;; (cl-destructuring-bind ;; ((a-expr . a) (b-expr . b)) @@ -390,6 +418,17 @@ :child-scheds `(,s0 ,s1) :leading-sched-dt (plist-get s1 :datetime))))))) + ;; TODO add deadline to this (but in absolute form) + (describe "Quarterly buffer statuses" + (it "Active" + (expect "aa3e549c-b309-40a2-a687-6d9791653a18" :id-to-be-qtp + :active nil '(2022 4 1)))) + + ;; (describe "Weekly buffer statuses" + ;; (it "Active (leaf)" + ;; (expect "ed1406ad-1231-46de-b026-8067411133dc" :id-to-be-wkp + ;; :active :leaf '(2022 6 6)))) + (describe "Metadata Tests" (it "parent tag" (expect (org-x-dag-id->tags "3de25d74-b90e-4c77-9f7f-8190187e7ed0")