From b7cb1c51e5663419344d8b55766635801f3ee4c8 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 5 Feb 2026 15:13:57 -0600 Subject: =?UTF-8?q?feat(calendar-sync):=20add=20event=20details=20?= =?UTF-8?q?=E2=80=94=20attendees,=20organizer,=20status,=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add ICS text unescaping (RFC 5545), HTML stripping, and new fields (attendees/status, organizer, meeting URL) to calendar-sync.el. event-to-org now outputs org property drawers. 88 new tests across 10 test files, 146/146 pass. Also fix pre-existing test require order and keymap guard issues. --- tests/test-calendar-sync--clean-text.el | 58 +++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 tests/test-calendar-sync--clean-text.el (limited to 'tests/test-calendar-sync--clean-text.el') diff --git a/tests/test-calendar-sync--clean-text.el b/tests/test-calendar-sync--clean-text.el new file mode 100644 index 00000000..86c8532b --- /dev/null +++ b/tests/test-calendar-sync--clean-text.el @@ -0,0 +1,58 @@ +;;; test-calendar-sync--clean-text.el --- Tests for clean-text composition -*- lexical-binding: t; -*- + +;;; Commentary: +;; Unit tests for calendar-sync--clean-text function. +;; Composes unescape-ics-text + strip-html, trims whitespace. Returns nil for nil. +;; Covers Normal, Boundary, and Error cases. + +;;; Code: + +(require 'ert) +(require 'testutil-calendar-sync) +(require 'calendar-sync) + +;;; Normal Cases + +(ert-deftest test-calendar-sync--clean-text-normal-both-html-and-ics () + "Test text with both HTML tags and ICS escapes." + (should (string= "Hello, World\nNext line" + (calendar-sync--clean-text "Hello\\, World
Next line")))) + +(ert-deftest test-calendar-sync--clean-text-normal-pure-ics-escapes () + "Test text with only ICS escapes." + (should (string= "a, b; c" + (calendar-sync--clean-text "a\\, b\\; c")))) + +(ert-deftest test-calendar-sync--clean-text-normal-pure-html () + "Test text with only HTML." + (should (string= "bold and italic" + (calendar-sync--clean-text "bold and italic")))) + +;;; Boundary Cases + +(ert-deftest test-calendar-sync--clean-text-boundary-already-clean () + "Test already-clean text passes through unchanged." + (should (string= "no escapes here" + (calendar-sync--clean-text "no escapes here")))) + +(ert-deftest test-calendar-sync--clean-text-boundary-empty-string () + "Test empty string returns empty string." + (should (string= "" (calendar-sync--clean-text "")))) + +(ert-deftest test-calendar-sync--clean-text-boundary-whitespace-only () + "Test whitespace-only string returns empty after trim." + (should (string= "" (calendar-sync--clean-text " \n \t ")))) + +(ert-deftest test-calendar-sync--clean-text-boundary-leading-trailing-whitespace () + "Test leading/trailing whitespace is trimmed." + (should (string= "content" + (calendar-sync--clean-text " content ")))) + +;;; Error Cases + +(ert-deftest test-calendar-sync--clean-text-error-nil-input () + "Test nil input returns nil." + (should (null (calendar-sync--clean-text nil)))) + +(provide 'test-calendar-sync--clean-text) +;;; test-calendar-sync--clean-text.el ends here -- cgit v1.2.3