aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/comp-tests.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index 79bac3f711f..a13235b2039 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -46,7 +46,7 @@
46 "Define a test for the native compiler tagging it as :nativecomp." 46 "Define a test for the native compiler tagging it as :nativecomp."
47 (declare (indent defun) 47 (declare (indent defun)
48 (doc-string 3)) 48 (doc-string 3))
49 `(ert-deftest ,(intern (concat "compt-tests-" (symbol-name name))) ,args 49 `(ert-deftest ,(intern (concat "comp-tests-" (symbol-name name))) ,args
50 :tags '(:nativecomp) 50 :tags '(:nativecomp)
51 ,@docstring-and-body)) 51 ,@docstring-and-body))
52 52
@@ -409,6 +409,17 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html."
409 (should (eq (comp-test-primitive-redefine-f 10 2) 'xxx)) 409 (should (eq (comp-test-primitive-redefine-f 10 2) 'xxx))
410 (should (equal comp-test-primitive-redefine-args '(10 2))))) 410 (should (equal comp-test-primitive-redefine-args '(10 2)))))
411 411
412(comp-deftest compile-forms ()
413 "Verify lambda form native compilation."
414 (should-error (native-compile '(+ 1 foo)))
415 (let ((f (native-compile '(lambda (x) (1+ x)))))
416 (should (subr-native-elisp-p f))
417 (should (= (funcall f 2) 3)))
418 (let* ((lexical-binding nil)
419 (f (native-compile '(lambda (x) (1+ x)))))
420 (should (subr-native-elisp-p f))
421 (should (= (funcall f 2) 3))))
422
412 423
413;;;;;;;;;;;;;;;;;;;;; 424;;;;;;;;;;;;;;;;;;;;;
414;; Tromey's tests. ;; 425;; Tromey's tests. ;;