diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/automated/cl-lib-tests.el | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/automated/cl-lib-tests.el b/test/automated/cl-lib-tests.el index 1c36e7d7abf..2c188a40059 100644 --- a/test/automated/cl-lib-tests.el +++ b/test/automated/cl-lib-tests.el | |||
| @@ -427,4 +427,21 @@ | |||
| 427 | (ert-deftest cl-flet-test () | 427 | (ert-deftest cl-flet-test () |
| 428 | (should (equal (cl-flet ((f1 (x) x)) (let ((x #'f1)) (funcall x 5))) 5))) | 428 | (should (equal (cl-flet ((f1 (x) x)) (let ((x #'f1)) (funcall x 5))) 5))) |
| 429 | 429 | ||
| 430 | (ert-deftest cl-lib-test-typep () | ||
| 431 | (cl-deftype cl-lib-test-type (&optional x) `(member ,x)) | ||
| 432 | ;; Make sure we correctly implement the rule that deftype's optional args | ||
| 433 | ;; default to `*' rather than to nil. | ||
| 434 | (should (cl-typep '* 'cl-lib-test-type)) | ||
| 435 | (should-not (cl-typep 1 'cl-lib-test-type))) | ||
| 436 | |||
| 437 | (ert-deftest cl-lib-arglist-performance () | ||
| 438 | ;; An `&aux' should not cause lambda's arglist to be turned into an &rest | ||
| 439 | ;; that's parsed by hand. | ||
| 440 | (should (eq () (nth 1 (nth 1 (macroexpand | ||
| 441 | '(cl-function (lambda (&aux (x 1)) x))))))) | ||
| 442 | (cl-defstruct (cl-lib--s (:constructor cl-lib--s-make (&optional a))) a) | ||
| 443 | ;; Similarly the &cl-defs thingy shouldn't cause fallback to manual parsing | ||
| 444 | ;; of args if the default for optional args is nil. | ||
| 445 | (should (equal '(&optional a) (help-function-arglist 'cl-lib--s-make)))) | ||
| 446 | |||
| 430 | ;;; cl-lib.el ends here | 447 | ;;; cl-lib.el ends here |