aboutsummaryrefslogtreecommitdiff
path: root/tests/test-pearl-mapping.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-25 21:30:34 -0500
committerCraig Jennings <c@cjennings.net>2026-05-25 21:30:34 -0500
commit1de0623168d13c51fb9a7c8a87f89030642ae4d0 (patch)
treea4edf8b91ebafe8590145488f88b47a887ca716c /tests/test-pearl-mapping.el
parent60b51e1c996f1c8f152696946b9440f26ea9a956 (diff)
downloadpearl-1de0623168d13c51fb9a7c8a87f89030642ae4d0.tar.gz
pearl-1de0623168d13c51fb9a7c8a87f89030642ae4d0.zip
refactor(save): remove the immediate-state-push org-sync machinery
The opt-in org-sync mode pushed Linear state immediately — on every TODO-keyword cycle (the org-after-todo-state-change hook) and on every buffer save (the after-save hook scanning the whole file). That's the last immediate-push path, and it contradicts the one-write-path model the rest of v2 builds, so I removed it: pearl-enable-org-sync / -disable-org-sync, pearl-org-hook-function, pearl-sync-org-to-linear, pearl-sync-current-heading-to-linear, and the now-orphaned pearl--process-heading-at-point, pearl--map-org-state-to-linear, and pearl--update-issue-state-async. This finishes the "make org-sync private" task — there was nothing left to make private. Cycling a TODO keyword now marks state dirty (reconciled at the next save) instead of pushing. Saving the buffer pushes nothing. Re-introducing an auto-push on save is the separate "Automatic sync on save" task, which would call the save engine rather than this whole-file scanner. I kept pearl--extract-org-heading-properties and pearl--get-todo-states-pattern. They're general heading/keyword readers, not org-sync-specific, and the keyword-cycle save (the keyword-derivation follow-up) needs exactly them. The obsolete sync tests are replaced by two that assert the contract: the sync commands are gone, and a keyword cycle pushes nothing.
Diffstat (limited to 'tests/test-pearl-mapping.el')
-rw-r--r--tests/test-pearl-mapping.el20
1 files changed, 4 insertions, 16 deletions
diff --git a/tests/test-pearl-mapping.el b/tests/test-pearl-mapping.el
index 17eff82..2a96163 100644
--- a/tests/test-pearl-mapping.el
+++ b/tests/test-pearl-mapping.el
@@ -54,22 +54,10 @@
(test-pearl--with-mapping '(("Todo" . "TODO"))
(should (string-equal "TODO" (pearl--map-linear-state-to-org nil)))))
-;;; pearl--map-org-state-to-linear
-
-(ert-deftest test-pearl-map-org-state-to-linear-mapped-returns-state ()
- "An org keyword present in the mapping returns its Linear state."
- (test-pearl--with-mapping '(("Todo" . "TODO") ("In Progress" . "DOING"))
- (should (string-equal "In Progress" (pearl--map-org-state-to-linear "DOING")))))
-
-(ert-deftest test-pearl-map-org-state-to-linear-unmapped-returns-nil ()
- "An org keyword not in the mapping returns nil."
- (test-pearl--with-mapping '(("Todo" . "TODO") ("Done" . "DONE"))
- (should (null (pearl--map-org-state-to-linear "WAITING")))))
-
-(ert-deftest test-pearl-map-org-state-to-linear-nil-returns-nil ()
- "A nil org keyword returns nil."
- (test-pearl--with-mapping '(("Todo" . "TODO"))
- (should (null (pearl--map-org-state-to-linear nil)))))
+;; pearl--map-org-state-to-linear (the keyword->state reverse map) was removed
+;; with the org-sync push path in save-model-v2; the keyword-cycle save will
+;; resolve through the team's states (the keyword-derivation task), not a flat
+;; reverse mapping.
;;; pearl--get-todo-states-pattern