diff options
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/eval-tests.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el index 4f05d99136b..727c98aa5fa 100644 --- a/test/src/eval-tests.el +++ b/test/src/eval-tests.el | |||
| @@ -86,23 +86,27 @@ Bug#24912." | |||
| 86 | 86 | ||
| 87 | (ert-deftest eval-tests--if-dot-string () | 87 | (ert-deftest eval-tests--if-dot-string () |
| 88 | "Check that Emacs rejects (if . \"string\")." | 88 | "Check that Emacs rejects (if . \"string\")." |
| 89 | (should-error (eval '(if . "abc")) :type 'wrong-type-argument) | 89 | (should-error (eval '(if . "abc") nil) :type 'wrong-type-argument) |
| 90 | (should-error (eval '(if . "abc") t) :type 'wrong-type-argument) | ||
| 90 | (let ((if-tail (list '(setcdr if-tail "abc") t))) | 91 | (let ((if-tail (list '(setcdr if-tail "abc") t))) |
| 91 | (should-error (eval (cons 'if if-tail)))) | 92 | (should-error (eval (cons 'if if-tail) nil) :type 'void-variable) |
| 93 | (should-error (eval (cons 'if if-tail) t) :type 'void-variable)) | ||
| 92 | (let ((if-tail (list '(progn (setcdr if-tail "abc") nil) t))) | 94 | (let ((if-tail (list '(progn (setcdr if-tail "abc") nil) t))) |
| 93 | (should-error (eval (cons 'if if-tail))))) | 95 | (should-error (eval (cons 'if if-tail) nil) :type 'void-variable) |
| 96 | (should-error (eval (cons 'if if-tail) t) :type 'void-variable))) | ||
| 94 | 97 | ||
| 95 | (ert-deftest eval-tests--let-with-circular-defs () | 98 | (ert-deftest eval-tests--let-with-circular-defs () |
| 96 | "Check that Emacs reports an error for (let VARS ...) when VARS is circular." | 99 | "Check that Emacs reports an error for (let VARS ...) when VARS is circular." |
| 97 | (let ((vars (list 'v))) | 100 | (let ((vars (list 'v))) |
| 98 | (setcdr vars vars) | 101 | (setcdr vars vars) |
| 99 | (dolist (let-sym '(let let*)) | 102 | (dolist (let-sym '(let let*)) |
| 100 | (should-error (eval (list let-sym vars)))))) | 103 | (should-error (eval (list let-sym vars) nil))))) |
| 101 | 104 | ||
| 102 | (ert-deftest eval-tests--mutating-cond () | 105 | (ert-deftest eval-tests--mutating-cond () |
| 103 | "Check that Emacs doesn't crash on a cond clause that mutates during eval." | 106 | "Check that Emacs doesn't crash on a cond clause that mutates during eval." |
| 104 | (let ((clauses (list '((progn (setcdr clauses "ouch") nil))))) | 107 | (let ((clauses (list '((progn (setcdr clauses "ouch") nil))))) |
| 105 | (should-error (eval (cons 'cond clauses))))) | 108 | (should-error (eval (cons 'cond clauses) nil)) |
| 109 | (should-error (eval (cons 'cond clauses) t)))) | ||
| 106 | 110 | ||
| 107 | (defun eval-tests--exceed-specbind-limit () | 111 | (defun eval-tests--exceed-specbind-limit () |
| 108 | (defvar eval-tests--var1) | 112 | (defvar eval-tests--var1) |
| @@ -184,7 +188,8 @@ are found on the stack and therefore not garbage collected." | |||
| 184 | Don't handle destructive splicing in backquote expressions (like | 188 | Don't handle destructive splicing in backquote expressions (like |
| 185 | in Common Lisp). Instead, make sure substitution in backquote | 189 | in Common Lisp). Instead, make sure substitution in backquote |
| 186 | expressions works for identifiers starting with period." | 190 | expressions works for identifiers starting with period." |
| 187 | (should (equal (let ((.x 'identity)) (eval `(,.x 'ok))) 'ok))) | 191 | (should (equal (let ((.x 'identity)) (eval `(,.x 'ok) nil)) 'ok)) |
| 192 | (should (equal (let ((.x 'identity)) (eval `(,.x 'ok) t)) 'ok))) | ||
| 188 | 193 | ||
| 189 | (ert-deftest eval-tests/backtrace-in-batch-mode () | 194 | (ert-deftest eval-tests/backtrace-in-batch-mode () |
| 190 | (let ((emacs (expand-file-name invocation-name invocation-directory))) | 195 | (let ((emacs (expand-file-name invocation-name invocation-directory))) |