aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorPhilipp Stephani2017-01-18 19:49:58 +0100
committerPhilipp Stephani2017-01-19 17:17:50 +0100
commit9c4e3097b595c739bb29261759b9ba631431329e (patch)
treec1b3bf8f62a29dd9289fea6f7342b7765b3d70a8 /test/src
parent8c0fcaf66733f0538a3f024f383cb34a3c93d73c (diff)
downloademacs-9c4e3097b595c739bb29261759b9ba631431329e.tar.gz
emacs-9c4e3097b595c739bb29261759b9ba631431329e.zip
Check that variable lists are actually lists
'let' and 'let*' document that their first argument has to be a list, but don't check for that; instead, they allow (and silently ignore) other types. Introduce an explicit type check. * src/eval.c (Flet, FletX): Check that the variable list is indeed a list. * test/src/eval-tests.el: Add unit tests.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/eval-tests.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el
index a1fe8ccd7d9..95655eac826 100644
--- a/test/src/eval-tests.el
+++ b/test/src/eval-tests.el
@@ -47,4 +47,14 @@ Bug#24912 and Bug#24913."
47 (let ((byte-compile-debug t)) 47 (let ((byte-compile-debug t))
48 (should-error (eval `(byte-compile (lambda ,args)) t))))) 48 (should-error (eval `(byte-compile (lambda ,args)) t)))))
49 49
50
51(dolist (form '(let let*))
52 (dolist (arg '(1 "a" [a]))
53 (eval
54 `(ert-deftest ,(intern (format "eval-tests--%s--%s" form (type-of arg))) ()
55 ,(format "Check that the first argument of `%s' cannot be a %s"
56 form (type-of arg))
57 (should-error (,form ,arg) :type 'wrong-type-argument))
58 t)))
59
50;;; eval-tests.el ends here 60;;; eval-tests.el ends here