From 74ca4e066bc41ce0a6e94e2d4bc0c838df45a838 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 22 Apr 2026 09:43:02 -0500 Subject: refactor: move 12 internal helpers from chime- to chime-- prefix Before MELPA submission, tighten the public API surface. Single-dash chime-foo is the convention for user-facing commands and predicates that external code can bind. Anything that is not meant to be bound externally should use the double-dash chime--foo prefix so byte-compile warnings, docstrings, and MELPA package inspection all point in the same direction. Twelve helpers in chime.el had single-dash names but no user-facing role. They are not mentioned in README, they carry no interactive declaration, and their docstrings do not promise a behavior contract. Rename them: chime-get-minutes-into-day, chime-get-hours-minutes-from-time, chime-set-hours-minutes-for-time, chime-current-time-matches-time-of-day-string, chime-current-time-is-day-wide-time, chime-day-wide-notifications, chime-display-as-day-wide-event, chime-event-has-any-day-wide-timestamp, chime-event-within-advance-notice-window, chime-event-has-any-passed-time, chime-event-is-today, chime-environment-regex. The public API surface is now intentional. It covers chime-mode, chime-validate-configuration, chime-refresh-modeline, chime-done-keywords-predicate, and the chime-debug-* interactive commands in chime-debug.el. Breaking change. No alias shims because there are no downstream users yet. --- tests/test-chime-event-is-today.el | 46 +++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'tests/test-chime-event-is-today.el') diff --git a/tests/test-chime-event-is-today.el b/tests/test-chime-event-is-today.el index f825174..305749a 100644 --- a/tests/test-chime-event-is-today.el +++ b/tests/test-chime-event-is-today.el @@ -1,4 +1,4 @@ -;;; test-chime-event-is-today.el --- Tests for chime-event-is-today -*- lexical-binding: t; -*- +;;; test-chime--event-is-today.el --- Tests for chime--event-is-today -*- lexical-binding: t; -*- ;; Copyright (C) 2026 Craig Jennings @@ -19,12 +19,12 @@ ;;; Commentary: -;; Unit tests for chime-event-is-today function. +;; Unit tests for chime--event-is-today function. ;; This function checks if an event has any timestamps specifically on today's ;; date (not past days, not future days). ;; ;; NOTE: These tests use real dates (not with-test-time) because -;; chime-event-is-today uses (decode-time) without arguments internally, +;; chime--event-is-today uses (decode-time) without arguments internally, ;; which calls the C-level current_time and bypasses Lisp-level mocking. ;;; Code: @@ -73,54 +73,54 @@ ;;; Normal Cases -(ert-deftest test-chime-event-is-today-timed-event-today () +(ert-deftest test-chime--event-is-today-timed-event-today () "A timed event happening today should return truthy." (let ((event (test--make-timed-event (test--real-today-at 14 30)))) - (should (chime-event-is-today event)))) + (should (chime--event-is-today event)))) -(ert-deftest test-chime-event-is-today-all-day-event-today () +(ert-deftest test-chime--event-is-today-all-day-event-today () "An all-day event for today should return truthy." (let ((event (test--make-all-day-event (test--real-today-at 0 0)))) - (should (chime-event-is-today event)))) + (should (chime--event-is-today event)))) -(ert-deftest test-chime-event-is-today-yesterday-returns-nil () +(ert-deftest test-chime--event-is-today-yesterday-returns-nil () "An event from yesterday should return nil." (let ((event (test--make-timed-event (test--real-yesterday-at 14 30)))) - (should-not (chime-event-is-today event)))) + (should-not (chime--event-is-today event)))) -(ert-deftest test-chime-event-is-today-tomorrow-returns-nil () +(ert-deftest test-chime--event-is-today-tomorrow-returns-nil () "An event for tomorrow should return nil." (let ((event (test--make-timed-event (test--real-tomorrow-at 14 30)))) - (should-not (chime-event-is-today event)))) + (should-not (chime--event-is-today event)))) -(ert-deftest test-chime-event-is-today-past-timed-event-today () +(ert-deftest test-chime--event-is-today-past-timed-event-today () "A timed event earlier today (in the past) should return truthy." (let ((event (test--make-timed-event (test--real-today-at 0 1)))) - (should (chime-event-is-today event)))) + (should (chime--event-is-today event)))) -(ert-deftest test-chime-event-is-today-future-timed-event-today () +(ert-deftest test-chime--event-is-today-future-timed-event-today () "A timed event later today (in the future) should return truthy." (let ((event (test--make-timed-event (test--real-today-at 23 58)))) - (should (chime-event-is-today event)))) + (should (chime--event-is-today event)))) ;;; Boundary Cases -(ert-deftest test-chime-event-is-today-event-at-2359-today () +(ert-deftest test-chime--event-is-today-event-at-2359-today () "An event at 23:59 today should return truthy." (let ((event (test--make-timed-event (test--real-today-at 23 59)))) - (should (chime-event-is-today event)))) + (should (chime--event-is-today event)))) -(ert-deftest test-chime-event-is-today-event-at-0000-today () +(ert-deftest test-chime--event-is-today-event-at-0000-today () "An event at 00:00 today should return truthy." (let ((event (test--make-timed-event (test--real-today-at 0 0)))) - (should (chime-event-is-today event)))) + (should (chime--event-is-today event)))) ;;; Error Cases -(ert-deftest test-chime-event-is-today-empty-times-returns-nil () +(ert-deftest test-chime--event-is-today-empty-times-returns-nil () "An event with no times should return nil." (let ((event '((times . ())))) - (should-not (chime-event-is-today event)))) + (should-not (chime--event-is-today event)))) -(provide 'test-chime-event-is-today) -;;; test-chime-event-is-today.el ends here +(provide 'test-chime--event-is-today) +;;; test-chime--event-is-today.el ends here -- cgit v1.2.3