diff options
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/buffer-tests.el | 5 | ||||
| -rw-r--r-- | test/src/eval-tests.el | 20 |
2 files changed, 25 insertions, 0 deletions
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el index 793dddd8bd4..87406740a78 100644 --- a/test/src/buffer-tests.el +++ b/test/src/buffer-tests.el | |||
| @@ -45,4 +45,9 @@ with parameters from the *Messages* buffer modification." | |||
| 45 | (should (eq buf (current-buffer)))) | 45 | (should (eq buf (current-buffer)))) |
| 46 | (when msg-ov (delete-overlay msg-ov)))))) | 46 | (when msg-ov (delete-overlay msg-ov)))))) |
| 47 | 47 | ||
| 48 | (ert-deftest test-generate-new-buffer-name-bug27966 () | ||
| 49 | (should-not (string-equal "nil" | ||
| 50 | (progn (get-buffer-create "nil") | ||
| 51 | (generate-new-buffer-name "nil"))))) | ||
| 52 | |||
| 48 | ;;; buffer-tests.el ends here | 53 | ;;; buffer-tests.el ends here |
diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el index 03f408716b1..b98de0aa65e 100644 --- a/test/src/eval-tests.el +++ b/test/src/eval-tests.el | |||
| @@ -59,4 +59,24 @@ Bug#24912 and Bug#24913." | |||
| 59 | (should-error (,form ,arg) :type 'wrong-type-argument)) | 59 | (should-error (,form ,arg) :type 'wrong-type-argument)) |
| 60 | t))) | 60 | t))) |
| 61 | 61 | ||
| 62 | (ert-deftest eval-tests--if-dot-string () | ||
| 63 | "Check that Emacs rejects (if . \"string\")." | ||
| 64 | (should-error (eval '(if . "abc")) :type 'wrong-type-argument) | ||
| 65 | (let ((if-tail (list '(setcdr if-tail "abc") t))) | ||
| 66 | (should-error (eval (cons 'if if-tail)))) | ||
| 67 | (let ((if-tail (list '(progn (setcdr if-tail "abc") nil) t))) | ||
| 68 | (should-error (eval (cons 'if if-tail))))) | ||
| 69 | |||
| 70 | (ert-deftest eval-tests--let-with-circular-defs () | ||
| 71 | "Check that Emacs reports an error for (let VARS ...) when VARS is circular." | ||
| 72 | (let ((vars (list 'v))) | ||
| 73 | (setcdr vars vars) | ||
| 74 | (dolist (let-sym '(let let*)) | ||
| 75 | (should-error (eval (list let-sym vars)))))) | ||
| 76 | |||
| 77 | (ert-deftest eval-tests--mutating-cond () | ||
| 78 | "Check that Emacs doesn't crash on a cond clause that mutates during eval." | ||
| 79 | (let ((clauses (list '((progn (setcdr clauses "ouch") nil))))) | ||
| 80 | (should-error (eval (cons 'cond clauses))))) | ||
| 81 | |||
| 62 | ;;; eval-tests.el ends here | 82 | ;;; eval-tests.el ends here |