summaryrefslogtreecommitdiff
path: root/tests/test-calendar-sync--sanitize-org-body.el
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-calendar-sync--sanitize-org-body.el')
-rw-r--r--tests/test-calendar-sync--sanitize-org-body.el24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test-calendar-sync--sanitize-org-body.el b/tests/test-calendar-sync--sanitize-org-body.el
index c38c277e..636946db 100644
--- a/tests/test-calendar-sync--sanitize-org-body.el
+++ b/tests/test-calendar-sync--sanitize-org-body.el
@@ -70,5 +70,29 @@
"Lone asterisk with space at start of line is sanitized."
(should (equal "- " (calendar-sync--sanitize-org-body "* "))))
+;;; Heading and Property Sanitizers
+
+(ert-deftest test-calendar-sync--sanitize-org-heading-flattens-newlines ()
+ "Heading text should stay on one Org heading line."
+ (should (equal "Planning Agenda"
+ (calendar-sync--sanitize-org-heading "Planning\nAgenda"))))
+
+(ert-deftest test-calendar-sync--sanitize-org-heading-replaces-leading-stars ()
+ "Heading text should not start with Org heading stars."
+ (should (equal "- Planning -- Hidden"
+ (calendar-sync--sanitize-org-heading "* Planning\n** Hidden"))))
+
+(ert-deftest test-calendar-sync--sanitize-org-property-value-flattens-structure ()
+ "Property values should not create extra property drawer lines."
+ (should (equal "Room 1 :END: * Not a heading"
+ (calendar-sync--sanitize-org-property-value
+ "Room 1\n:END:\n* Not a heading"))))
+
+(ert-deftest test-calendar-sync--sanitize-org-property-value-trims-and-collapses ()
+ "Property values should be compact single-line values."
+ (should (equal "alpha beta gamma"
+ (calendar-sync--sanitize-org-property-value
+ " alpha\t beta\n\n gamma "))))
+
(provide 'test-calendar-sync--sanitize-org-body)
;;; test-calendar-sync--sanitize-org-body.el ends here