From bd2aa5705d94b7d403096c62637e64c479ea0de5 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 25 May 2026 07:45:56 -0500 Subject: refactor: rename pearl--issue-body-at-point to pearl--entry-body-at-point The helper returns the body of the Org entry at point, before any child heading. It started out reading issue descriptions, but comment editing and deletion reuse it for comment bodies too, so "issue" in the name was misleading. I renamed it across its callers and the sync/refresh/save/comment tests, and reworded the docstring to say "entry". --- tests/test-pearl-sync.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/test-pearl-sync.el') diff --git a/tests/test-pearl-sync.el b/tests/test-pearl-sync.el index 738e3ff..150944a 100644 --- a/tests/test-pearl-sync.el +++ b/tests/test-pearl-sync.el @@ -21,7 +21,7 @@ ;; Tests for the explicit description sync-back: the pure conflict gate ;; (`pearl--sync-decision'), the org body extractor -;; (`pearl--issue-body-at-point'), the two network helpers (fetch the +;; (`pearl--entry-body-at-point'), the two network helpers (fetch the ;; remote description, push an updated description -- both stubbed at the HTTP ;; boundary), and the orchestrating command `pearl-sync-current-issue' ;; across its no-op / clean-push / conflict branches. @@ -73,26 +73,26 @@ "*** TODO ENG-1 Title\n:PROPERTIES:\n:LINEAR-ID: a\n:END:\nThe body line.\nSecond line.\n" (re-search-forward "Title") (should (string= "The body line.\nSecond line." - (pearl--issue-body-at-point))))) + (pearl--entry-body-at-point))))) (ert-deftest test-pearl-issue-body-empty () "An entry with no body yields the empty string." (test-pearl--in-org "*** TODO ENG-1 Title\n:PROPERTIES:\n:LINEAR-ID: a\n:END:\n" - (should (string= "" (pearl--issue-body-at-point))))) + (should (string= "" (pearl--entry-body-at-point))))) (ert-deftest test-pearl-issue-body-stops-before-comments () "The description body stops before a child Comments subtree." (test-pearl--in-org "*** TODO ENG-1 Title\n:PROPERTIES:\n:LINEAR-ID: a\n:END:\nDesc body.\n**** Comments\n***** bob -- ts\nhi\n" - (should (string= "Desc body." (pearl--issue-body-at-point))))) + (should (string= "Desc body." (pearl--entry-body-at-point))))) (ert-deftest test-pearl-issue-body-from-inside-body () "Extraction works with point already inside the body." (test-pearl--in-org "*** TODO ENG-1 Title\n:PROPERTIES:\n:LINEAR-ID: a\n:END:\nDesc body.\nmore.\n" (goto-char (point-max)) - (should (string= "Desc body.\nmore." (pearl--issue-body-at-point))))) + (should (string= "Desc body.\nmore." (pearl--entry-body-at-point))))) ;;; network helpers (stubbed at the HTTP boundary) @@ -219,7 +219,7 @@ helper (nil when never called); the update helper reports success." ;; ... but provenance is not advanced and the edit stays for retry. (should (string= stored (org-entry-get nil "LINEAR-DESC-SHA256"))) (should (string= "old" (org-entry-get nil "LINEAR-DESC-UPDATED-AT"))) - (should (string= "Edited body now." (pearl--issue-body-at-point))))))) + (should (string= "Edited body now." (pearl--entry-body-at-point))))))) (provide 'test-pearl-sync) ;;; test-pearl-sync.el ends here -- cgit v1.2.3