diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-calendar-sync--event-to-org.el | 6 | ||||
| -rw-r--r-- | tests/test-calendar-sync--get-property.el | 20 |
2 files changed, 25 insertions, 1 deletions
diff --git a/tests/test-calendar-sync--event-to-org.el b/tests/test-calendar-sync--event-to-org.el index e6609e20..96ce49d5 100644 --- a/tests/test-calendar-sync--event-to-org.el +++ b/tests/test-calendar-sync--event-to-org.el @@ -26,7 +26,11 @@ :status "accepted" :url "https://meet.google.com/abc-defg-hij"))) (let ((result (calendar-sync--event-to-org event))) - (should (string-match-p "\\* Team Standup" result)) + ;; Verify heading comes before timestamp + (should (string-match "\\* Team Standup" result)) + (let ((heading-pos (match-beginning 0))) + (should (string-match "<[0-9]" result)) + (should (< heading-pos (match-beginning 0)))) (should (string-match-p ":PROPERTIES:" result)) (should (string-match-p ":LOCATION: Conference Room A" result)) (should (string-match-p ":ORGANIZER: John Smith" result)) diff --git a/tests/test-calendar-sync--get-property.el b/tests/test-calendar-sync--get-property.el index 8b71f8e3..20551860 100644 --- a/tests/test-calendar-sync--get-property.el +++ b/tests/test-calendar-sync--get-property.el @@ -133,6 +133,26 @@ (should (equal (calendar-sync--get-property event "DESCRIPTION") "Tasks: setup; review; deploy"))) (test-calendar-sync--get-property-teardown))) +(ert-deftest test-calendar-sync--get-property-boundary-continuation-lines-joined () + "Test extracting property value with RFC 5545 continuation lines. +Folded lines start with a space or tab and should be joined." + (test-calendar-sync--get-property-setup) + (unwind-protect + (let ((event "BEGIN:VEVENT\nDESCRIPTION:This is a long\n description that spans\n multiple lines\nSUMMARY:Test\nEND:VEVENT")) + (should (equal (calendar-sync--get-property event "DESCRIPTION") + "This is a longdescription that spansmultiple lines"))) + (test-calendar-sync--get-property-teardown))) + +(ert-deftest test-calendar-sync--get-property-boundary-continuation-with-html () + "Test that HTML tags split across continuation lines are fully captured." + (test-calendar-sync--get-property-setup) + (unwind-protect + (let ((event "BEGIN:VEVENT\nDESCRIPTION:Created by <a href=\"https://ex\n ample.com\">link</a> here\nEND:VEVENT")) + (let ((value (calendar-sync--get-property event "DESCRIPTION"))) + (should (string-match-p "example.com" value)) + (should (string-match-p "</a>" value)))) + (test-calendar-sync--get-property-teardown))) + ;;; Error Cases (ert-deftest test-calendar-sync--get-property-error-missing-property-returns-nil () |
