diff options
| author | Noam Postavsky | 2017-09-25 07:15:51 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2017-09-25 19:39:19 -0400 |
| commit | 79162cb0db1b62eec35f4fec0e6eac8669bc8f37 (patch) | |
| tree | 3af4ce4b85e94ae6e5cc1e0fada8d548318d2327 /test | |
| parent | 66d35ae49dae8815910198586e277895671bd19b (diff) | |
| download | emacs-79162cb0db1b62eec35f4fec0e6eac8669bc8f37.tar.gz emacs-79162cb0db1b62eec35f4fec0e6eac8669bc8f37.zip | |
Fix subr-x-tests when running from elc
* test/lisp/emacs-lisp/subr-x-tests.el (subr-x-and-let*-test-group-1):
Use `eval' around the `should-error' cases.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/subr-x-tests.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/lisp/emacs-lisp/subr-x-tests.el b/test/lisp/emacs-lisp/subr-x-tests.el index 2c6740a96cf..0e8871d9a9c 100644 --- a/test/lisp/emacs-lisp/subr-x-tests.el +++ b/test/lisp/emacs-lisp/subr-x-tests.el | |||
| @@ -397,9 +397,14 @@ | |||
| 397 | (should (equal 1 (let ((x 1)) (and-let* (x))))) | 397 | (should (equal 1 (let ((x 1)) (and-let* (x))))) |
| 398 | (should (equal nil (and-let* ((x nil))))) | 398 | (should (equal nil (and-let* ((x nil))))) |
| 399 | (should (equal 1 (and-let* ((x 1))))) | 399 | (should (equal 1 (and-let* ((x 1))))) |
| 400 | (should-error (and-let* (nil (x 1))) :type 'setting-constant) | 400 | ;; The error doesn't trigger when compiled: the compiler will give |
| 401 | ;; a warning and then drop the erroneous code. Therefore, use | ||
| 402 | ;; `eval' to avoid compilation. | ||
| 403 | (should-error (eval '(and-let* (nil (x 1))) lexical-binding) | ||
| 404 | :type 'setting-constant) | ||
| 401 | (should (equal nil (and-let* ((nil) (x 1))))) | 405 | (should (equal nil (and-let* ((nil) (x 1))))) |
| 402 | (should-error (and-let* (2 (x 1))) :type 'wrong-type-argument) | 406 | (should-error (eval (and-let* (2 (x 1))) lexical-binding) |
| 407 | :type 'wrong-type-argument) | ||
| 403 | (should (equal 1 (and-let* ((2) (x 1))))) | 408 | (should (equal 1 (and-let* ((2) (x 1))))) |
| 404 | (should (equal 2 (and-let* ((x 1) (2))))) | 409 | (should (equal 2 (and-let* ((x 1) (2))))) |
| 405 | (should (equal nil (let ((x nil)) (and-let* (x) x)))) | 410 | (should (equal nil (let ((x nil)) (and-let* (x) x)))) |