Repair setopt test after error demotion to warning

* test/lisp/cus-edit-tests.el (test-setopt):
Check for a warrning instead of an error in attempt to call `setopt`
with a value that does not match the declared type (bug#60162).
This commit is contained in:
Mattias Engdegård 2022-12-19 12:05:09 +01:00
parent 12e26cc0c1
commit b3e7768a0e

View file

@ -83,7 +83,14 @@
(ert-deftest test-setopt ()
(should (= (setopt cus-edit-test-foo1 1) 1))
(should (= cus-edit-test-foo1 1))
(should-error (setopt cus-edit-test-foo1 :foo)))
(let* ((text-quoting-style 'grave)
(warn-txt
(with-current-buffer (get-buffer-create "*Warnings*")
(let ((inhibit-read-only t))
(erase-buffer))
(setopt cus-edit-test-foo1 :foo)
(buffer-substring-no-properties (point-min) (point-max)))))
(should (string-search "Value `:foo' does not match type number"
warn-txt))))
(provide 'cus-edit-tests)
;;; cus-edit-tests.el ends here