diff options
author | Stefan Kangas <stefan@marxist.se> | 2020-12-02 11:29:26 +0100 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2020-12-02 13:11:07 +0100 |
commit | 17d9d90ec2affdd816047ce33d84117482b9cbe0 (patch) | |
tree | 193fd49d94e13322273b6482d034cce662d68fb0 /test/lisp | |
parent | b7c43b85fa01896a4b500e8e4406cd1066d6bb92 (diff) | |
download | emacs-17d9d90ec2affdd816047ce33d84117482b9cbe0.tar.gz |
Improve sectioning in bytecomp-tests.el
* test/lisp/emacs-lisp/bytecomp-tests.el: Add section comments.
(test-eager-load-macro-expansion)
(test-eager-load-macro-expansion-eval-and-compile): Move definitions.
Diffstat (limited to 'test/lisp')
-rw-r--r-- | test/lisp/emacs-lisp/bytecomp-tests.el | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index d9052da5436..7ed90217365 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -490,6 +490,9 @@ Subtests signal errors if something goes wrong." (defun def () (m)))) (should (equal (funcall 'def) 4))) + +;;;; Warnings. + (ert-deftest bytecomp-tests--warnings () (with-current-buffer (get-buffer-create "*Compile-Log*") (let ((inhibit-read-only t)) (erase-buffer))) @@ -537,16 +540,6 @@ Subtests signal errors if something goes wrong." (bytecomp--with-warning-test "foo.*lacks a prefix" '(defvar foo nil))) -(ert-deftest test-eager-load-macro-expansion () - (test-byte-comp-compile-and-load nil - '(progn (defmacro abc (arg) 1) (defun def () (abc 2)))) - (should (equal (funcall 'def) 1))) - -(ert-deftest test-eager-load-macro-expansion-eval-and-compile () - (test-byte-comp-compile-and-load nil - '(eval-and-compile (defmacro abc (arg) -1) (defun def () (abc 2)))) - (should (equal (funcall 'def) -1))) - (defmacro bytecomp--define-warning-file-test (file re-warning &optional reverse) `(ert-deftest ,(intern (format "bytecomp/%s" file)) () :expected-result ,(if reverse :failed :passed) @@ -598,6 +591,19 @@ Subtests signal errors if something goes wrong." (bytecomp--define-warning-file-test "warn-interactive-only.el" "next-line.*interactive use only.*forward-line") + +;;;; Macro expansion. + +(ert-deftest test-eager-load-macro-expansion () + (test-byte-comp-compile-and-load nil + '(progn (defmacro abc (arg) 1) (defun def () (abc 2)))) + (should (equal (funcall 'def) 1))) + +(ert-deftest test-eager-load-macro-expansion-eval-and-compile () + (test-byte-comp-compile-and-load nil + '(eval-and-compile (defmacro abc (arg) -1) (defun def () (abc 2)))) + (should (equal (funcall 'def) -1))) + (ert-deftest test-eager-load-macro-expansion-eval-when-compile () ;; Make sure we interpret eval-when-compile forms properly. CLISP ;; and SBCL interpreter eval-when-compile (well, the CL equivalent) |