diff options
Diffstat (limited to 'test/lisp/emacs-lisp/bytecomp-tests.el')
-rw-r--r-- | test/lisp/emacs-lisp/bytecomp-tests.el | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index e3ce87cc9af..caece633459 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -1985,6 +1985,47 @@ EXPECTED-POINT BINDINGS (MODES \\='\\='(ruby-mode js-mode python-mode)) \ (dc 'integerp)) )) +(ert-deftest bytecomp-test-defcustom-local () + (cl-flet ((dc (local) `(defcustom mytest nil "doc" :type 'sexp :local ',local :group 'test))) + (bytecomp--with-warning-test + (rx ":local keyword does not accept 'symbol") (dc 'symbol)) + (bytecomp--with-warning-test + (rx ":local keyword does not accept \"string\"") (dc "string")) + (bytecomp--without-warning-test (dc t)) + (bytecomp--without-warning-test (dc 'permanent)) + (bytecomp--without-warning-test (dc 'permanent-only)) + )) + +(ert-deftest bytecomp-test-defface-spec () + (cl-flet ((df (spec) `(defface mytest ',spec "doc" :group 'test))) + (bytecomp--with-warning-test + (rx "Bad face display condition `max-colors'") + (df '((((class color grayscale) (max-colors 75) (background light)) + :foreground "cyan")))) + (bytecomp--with-warning-test + (rx "Bad face display `defualt'") + (df '((defualt :foreground "cyan")))) + (bytecomp--with-warning-test + (rx "`:inverse' is not a valid face attribute keyword") + (df '((t :background "blue" :inverse t)))) + (bytecomp--with-warning-test + (rx "`:inverse' is not a valid face attribute keyword") + (df '((t (:background "blue" :inverse t))))) ; old attr list syntax + (bytecomp--with-warning-test + (rx "Face attribute `:reverse-video' has been removed;" + " use `:inverse-video' instead") + (df '((t :background "red" :reverse-video t)))) + (bytecomp--with-warning-test + (rx "Value for face attribute `:inherit' should not be quoted") + (df '((t :inherit 'other)))) + (bytecomp--with-warning-test + (rx "Missing face attribute `:extend' value") + (df '((t :foundry "abc" :extend)))) + (bytecomp--with-warning-test + (rx "Non-keyword in face attribute list: `\"green\"'") + (df '((t :foreground "white" "green")))) + )) + (ert-deftest bytecomp-function-attributes () ;; Check that `byte-compile' keeps the declarations, interactive spec and ;; doc string of the function (bug#55830). |