aboutsummaryrefslogtreecommitdiff
path: root/tests/test-chime-numeric-defcustom-setters.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-11 14:54:03 -0500
committerCraig Jennings <c@cjennings.net>2026-06-11 14:54:03 -0500
commit6b8918b4cc44dc39e70a5544e8286eb781a97ccc (patch)
tree045a26a0a64d69bd2d3c562388956e502810ca71 /tests/test-chime-numeric-defcustom-setters.el
parent5541e60418b5c1cf44c0a0b6999589d10d20f7bd (diff)
downloadchime-6b8918b4cc44dc39e70a5544e8286eb781a97ccc.tar.gz
chime-6b8918b4cc44dc39e70a5544e8286eb781a97ccc.zip
test: add failing tests for the async fetch watchdog
Diffstat (limited to 'tests/test-chime-numeric-defcustom-setters.el')
-rw-r--r--tests/test-chime-numeric-defcustom-setters.el26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test-chime-numeric-defcustom-setters.el b/tests/test-chime-numeric-defcustom-setters.el
index 7fb5afa..ad339b9 100644
--- a/tests/test-chime-numeric-defcustom-setters.el
+++ b/tests/test-chime-numeric-defcustom-setters.el
@@ -161,6 +161,32 @@
'chime-max-consecutive-failures -1)
:type 'user-error)))
+;;;; chime-async-timeout — integer >= 1, or nil to disable
+
+(ert-deftest test-chime-async-timeout-accepts-positive-integer ()
+ "Normal: a positive timeout in seconds lands."
+ (let ((chime-async-timeout 120))
+ (customize-set-variable 'chime-async-timeout 300)
+ (should (= 300 chime-async-timeout))))
+
+(ert-deftest test-chime-async-timeout-accepts-nil ()
+ "Boundary: nil disables the watchdog (per docstring)."
+ (let ((chime-async-timeout 120))
+ (customize-set-variable 'chime-async-timeout nil)
+ (should (null chime-async-timeout))))
+
+(ert-deftest test-chime-async-timeout-rejects-zero ()
+ "Error: a zero-second timeout would interrupt every spawn immediately."
+ (let ((chime-async-timeout 120))
+ (should-error (customize-set-variable 'chime-async-timeout 0)
+ :type 'user-error)))
+
+(ert-deftest test-chime-async-timeout-rejects-non-integer ()
+ "Error: a string raises `user-error' at customize time."
+ (let ((chime-async-timeout 120))
+ (should-error (customize-set-variable 'chime-async-timeout "120")
+ :type 'user-error)))
+
;; Note: `chime--validation-max-retries' was demoted from defcustom to
;; defvar in 0.8 — no customize-time setter, no validation tests here.