From 69c8deb2d7821c78475dcbb08458df6b0e56d559 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 4 Apr 2026 12:40:27 -0500 Subject: Add 94 tests across 10 new test files and fix 2 bugs New test coverage for previously untested functions: - filter-day-wide-events, time utilities, day-wide time matching - make-tooltip, event-is-today, get-tags, done-keywords-predicate - extract-title, propertize-modeline-string, warn-persistent-failures - log-silently Bug fixes discovered by new tests: - Fix pluralization in no-events tooltip ("1 hours" -> "1 hour", etc.) - Fix chime--get-tags returning ("") instead of nil for untagged headings --- chime.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'chime.el') diff --git a/chime.el b/chime.el index de8a27c..c6455a2 100644 --- a/chime.el +++ b/chime.el @@ -1067,10 +1067,12 @@ Returns an alist of (DATE-STRING . EVENTS-LIST)." (let* ((hours (/ lookahead-minutes 60)) (days (/ hours 24)) (timeframe (cond - ((>= days 7) (format "%d days" days)) - ((>= hours 24) (format "%.1f days" (/ hours 24.0))) - ((>= hours 1) (format "%d hours" hours)) - (t (format "%d minutes" lookahead-minutes)))) + ((>= days 7) (format "%d day%s" days (if (= days 1) "" "s"))) + ((>= hours 24) (let ((d (/ hours 24.0))) + (format "%.1f day%s" d (if (= d 1.0) "" "s")))) + ((>= hours 1) (format "%d hour%s" hours (if (= hours 1) "" "s"))) + (t (format "%d minute%s" lookahead-minutes + (if (= lookahead-minutes 1) "" "s"))))) (header (format-time-string chime-tooltip-header-format)) (increase-var "chime-tooltip-lookahead-hours")) (concat header "\n" @@ -1240,9 +1242,8 @@ Tooltip shows events within `chime-tooltip-lookahead-hours' hours." (defun chime--get-tags (marker) "Retrieve tags of MARKER." - (-> (org-entry-get marker "TAGS") - (or "") - (org-split-string ":"))) + (when-let* ((tags-str (org-entry-get marker "TAGS"))) + (org-split-string tags-str ":"))) (defun chime--whitelist-predicates () "Return list of whitelist predicate functions. -- cgit v1.2.3