aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLars Ingebrigtsen2022-02-17 12:31:12 +0100
committerLars Ingebrigtsen2022-02-17 12:31:12 +0100
commit136f1cb54962f5dcae9e8b63e41e4df70995599c (patch)
tree2fc2c2300361b185dcf5e4c9db6a57bd66ca4316 /test
parent33a9ee2084f860610dbdc67bd3db237dcb64202e (diff)
downloademacs-136f1cb54962f5dcae9e8b63e41e4df70995599c.tar.gz
emacs-136f1cb54962f5dcae9e8b63e41e4df70995599c.zip
Have setopt check types
* doc/lispref/variables.texi (Setting Variables): Note type checking. * lisp/cus-edit.el (setopt--set): New function to avoid having Customize saving values, too. (setopt): Use it.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/cus-edit-tests.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/lisp/cus-edit-tests.el b/test/lisp/cus-edit-tests.el
index 01a1407dcaa..7a597ccf343 100644
--- a/test/lisp/cus-edit-tests.el
+++ b/test/lisp/cus-edit-tests.el
@@ -76,5 +76,13 @@
76 (customize-saved) 76 (customize-saved)
77 (should (search-forward cus-edit-tests--obsolete-option-tag nil t))))) 77 (should (search-forward cus-edit-tests--obsolete-option-tag nil t)))))
78 78
79(ert-deftest test-setopt ()
80 (defcustom cus-edit-test-foo1 0
81 ""
82 :type 'number)
83 (should (= (setopt cus-edit-test-foo1 1) 1))
84 (should (= cus-edit-test-foo1 1))
85 (should-error (setopt cus-edit-test-foo1 :foo)))
86
79(provide 'cus-edit-tests) 87(provide 'cus-edit-tests)
80;;; cus-edit-tests.el ends here 88;;; cus-edit-tests.el ends here