diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-23 23:40:58 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-23 23:40:58 -0400 |
| commit | 3814d633ec7087f7d720123a2a2054d14f646ea6 (patch) | |
| tree | c07fc109edae2a8c80fd0bb6bafff72fc8bba37a /tests | |
| parent | 081d76e4b9935217d650ae142bce6e8200e97b48 (diff) | |
| download | chime-3814d633ec7087f7d720123a2a2054d14f646ea6.tar.gz chime-3814d633ec7087f7d720123a2a2054d14f646ea6.zip | |
test: restore filter defcustom defaults in blacklist teardowns
test-chime-apply-blacklist and test-chime-whitelist-blacklist-conflicts reset the filter defcustoms with setq in their teardowns. The filters aren't buffer-local, so setq clobbers the global default and leaves it nil for every later test in the same Emacs. test-chime-declined-events-predicate-on-default-exclude-filters reads default-value, so it failed in a combined full-suite run while passing per-file.
The teardowns now call custom-reevaluate-setting to restore each filter to its standard value. Every test already let-binds its own filter values, so the global only needs returning to its default.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-chime-apply-blacklist.el | 5 | ||||
| -rw-r--r-- | tests/test-chime-whitelist-blacklist-conflicts.el | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/tests/test-chime-apply-blacklist.el b/tests/test-chime-apply-blacklist.el index df2f317..abfc3e8 100644 --- a/tests/test-chime-apply-blacklist.el +++ b/tests/test-chime-apply-blacklist.el @@ -41,7 +41,10 @@ (defun test-chime-apply-blacklist-teardown () "Teardown function run after each test." (chime-delete-test-base-dir) - (setq chime-exclude-filters nil)) + ;; Restore the defcustom default rather than leaving the global clobbered. + ;; Each test let-binds `chime-exclude-filters', so the global only needs to + ;; return to its standard value to keep cross-file test isolation. + (custom-reevaluate-setting 'chime-exclude-filters)) ;;; Normal Cases diff --git a/tests/test-chime-whitelist-blacklist-conflicts.el b/tests/test-chime-whitelist-blacklist-conflicts.el index 5becfe0..18b6680 100644 --- a/tests/test-chime-whitelist-blacklist-conflicts.el +++ b/tests/test-chime-whitelist-blacklist-conflicts.el @@ -45,8 +45,11 @@ (defun test-chime-conflicts-teardown () "Teardown function run after each test." (chime-delete-test-base-dir) - (setq chime-include-filters nil) - (setq chime-exclude-filters nil)) + ;; Restore the defcustom defaults rather than leaving the globals clobbered. + ;; Each test let-binds both filter vars, so the globals only need to return + ;; to their standard values to keep cross-file test isolation. + (custom-reevaluate-setting 'chime-include-filters) + (custom-reevaluate-setting 'chime-exclude-filters)) ;;; Keyword Conflict Tests |
