aboutsummaryrefslogtreecommitdiff
path: root/tests/test-chime-environment-regex.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-04-22 09:43:02 -0500
committerCraig Jennings <c@cjennings.net>2026-04-22 09:43:02 -0500
commit74ca4e066bc41ce0a6e94e2d4bc0c838df45a838 (patch)
tree0661131c768050815114bf6214b85abac3956771 /tests/test-chime-environment-regex.el
parent8511cf43f2bf4ab2dc539fd28427e6c81c98b901 (diff)
downloadchime-74ca4e066bc41ce0a6e94e2d4bc0c838df45a838.tar.gz
chime-74ca4e066bc41ce0a6e94e2d4bc0c838df45a838.zip
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.
Diffstat (limited to 'tests/test-chime-environment-regex.el')
-rw-r--r--tests/test-chime-environment-regex.el20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/test-chime-environment-regex.el b/tests/test-chime-environment-regex.el
index 2499ad0..2179198 100644
--- a/tests/test-chime-environment-regex.el
+++ b/tests/test-chime-environment-regex.el
@@ -1,4 +1,4 @@
-;;; test-chime-environment-regex.el --- Tests for chime-environment-regex -*- lexical-binding: t; -*-
+;;; test-chime--environment-regex.el --- Tests for chime--environment-regex -*- lexical-binding: t; -*-
;; Copyright (C) 2026 Craig Jennings
@@ -19,7 +19,7 @@
;;; Commentary:
-;; Unit tests for chime-environment-regex function.
+;; Unit tests for chime--environment-regex function.
;; This function generates the regex used by async-inject-variables to
;; copy chime's config into the async subprocess.
@@ -29,9 +29,9 @@
;;; Normal Cases
-(ert-deftest test-chime-environment-regex-matches-default-variables ()
+(ert-deftest test-chime--environment-regex-matches-default-variables ()
"The generated regex should match all default chime variable names."
- (let ((regex (chime-environment-regex))
+ (let ((regex (chime--environment-regex))
(chime-additional-environment-regexes nil))
(dolist (var '("org-agenda-files" "load-path" "org-todo-keywords"
"chime-alert-intervals" "chime-keyword-whitelist"
@@ -40,10 +40,10 @@
"chime-predicate-blacklist"))
(should (string-match-p regex var)))))
-(ert-deftest test-chime-environment-regex-includes-additional-regexes ()
+(ert-deftest test-chime--environment-regex-includes-additional-regexes ()
"With additional regexes configured, the result should match those too."
(let ((chime-additional-environment-regexes '("my-custom-var")))
- (let ((regex (chime-environment-regex)))
+ (let ((regex (chime--environment-regex)))
;; Should still match defaults
(should (string-match-p regex "org-agenda-files"))
;; Should also match the custom variable
@@ -51,12 +51,12 @@
;;; Boundary Cases
-(ert-deftest test-chime-environment-regex-empty-additional-list ()
+(ert-deftest test-chime--environment-regex-empty-additional-list ()
"Empty additional regexes list should produce a valid regex matching defaults."
(let ((chime-additional-environment-regexes nil))
- (let ((regex (chime-environment-regex)))
+ (let ((regex (chime--environment-regex)))
(should (stringp regex))
(should (string-match-p regex "chime-alert-intervals")))))
-(provide 'test-chime-environment-regex)
-;;; test-chime-environment-regex.el ends here
+(provide 'test-chime--environment-regex)
+;;; test-chime--environment-regex.el ends here