From b3e7768a0ee0e894d7a4c232842af8be014ff8cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Mon, 19 Dec 2022 12:05:09 +0100 Subject: [PATCH] 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). --- test/lisp/cus-edit-tests.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/lisp/cus-edit-tests.el b/test/lisp/cus-edit-tests.el index 0ef5168109b..31ba68b4107 100644 --- a/test/lisp/cus-edit-tests.el +++ b/test/lisp/cus-edit-tests.el @@ -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 -- 2.39.2