Commit 7ae0a24c authored by Michael Albinus's avatar Michael Albinus
Browse files

New test custom--test-theme-variables

* test/lisp/custom-tests.el (custom--test-user-option)
(custom--test-variable): New variables.
(custom--test-theme-variables): New test.

* test/lisp/custom-resources/custom--test-theme.el (custom--test):
New file.
parent f646675c
Pipeline #503 passed with stage
in 43 minutes and 45 seconds
(deftheme custom--test
"A test theme.")
(custom-theme-set-variables
'custom--test
'(custom--test-user-option 'bar)
'(custom--test-variable 'bar))
(provide-theme 'custom--test)
...@@ -84,4 +84,43 @@ ...@@ -84,4 +84,43 @@
(when (file-directory-p tmpdir) (when (file-directory-p tmpdir)
(delete-directory tmpdir t))))) (delete-directory tmpdir t)))))
(defcustom custom--test-user-option 'foo
"User option for test."
:group 'emacs
:type 'symbol)
(defvar custom--test-variable 'foo
"Variable for test.")
;; This is demonstrating bug#34027.
(ert-deftest custom--test-theme-variables ()
"Test variables setting with enabling / disabling a custom theme."
:expected-result :failed
;; We load custom-resources/custom--test-theme.el.
(let ((custom-theme-load-path
`(,(expand-file-name "custom-resources" (file-name-directory #$)))))
(load-theme 'custom--test 'no-confirm 'no-enable)
;; The variables have still their initial values.
(should (equal custom--test-user-option 'foo))
(should (equal custom--test-variable 'foo))
(custom-set-variables
'(custom--test-user-option 'baz)
'(custom--test-variable 'baz))
;; The initial values have been changed.
(should (equal custom--test-user-option 'baz))
(should (equal custom--test-variable 'baz))
(enable-theme 'custom--test)
;; The variables have the theme values.
(should (equal custom--test-user-option 'bar))
(should (equal custom--test-variable 'bar))
(disable-theme 'custom--test)
;; The variables should have the changed values, by reverting.
;; This doesn't work as expected. Instead, they have their
;; initial values `foo'.
(should (equal custom--test-user-option 'baz))
(should (equal custom--test-variable 'baz))))
;;; custom-tests.el ends here ;;; custom-tests.el ends here
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment