From: Stefan Kangas Date: Wed, 2 Dec 2020 10:29:26 +0000 (+0100) Subject: Improve sectioning in bytecomp-tests.el X-Git-Tag: emacs-28.0.90~4961 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=17d9d90ec2affdd816047ce33d84117482b9cbe0;p=emacs.git 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. --- 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)