diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/cl-lib-tests.el | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el index 26b19e93e42..98c4bd92de6 100644 --- a/test/lisp/emacs-lisp/cl-lib-tests.el +++ b/test/lisp/emacs-lisp/cl-lib-tests.el | |||
| @@ -500,4 +500,27 @@ | |||
| 500 | (should (eq (type-of x) 'foo)) | 500 | (should (eq (type-of x) 'foo)) |
| 501 | (should (eql (foo-x x) 42)))) | 501 | (should (eql (foo-x x) 42)))) |
| 502 | 502 | ||
| 503 | (ert-deftest old-struct () | ||
| 504 | (cl-defstruct foo x) | ||
| 505 | (let ((x [cl-struct-foo]) | ||
| 506 | (saved cl-old-struct-compat-mode)) | ||
| 507 | (cl-old-struct-compat-mode -1) | ||
| 508 | (should (eq (type-of x) 'vector)) | ||
| 509 | |||
| 510 | (cl-old-struct-compat-mode 1) | ||
| 511 | (setq cl-struct-foo (cl--struct-get-class 'foo)) | ||
| 512 | (setf (symbol-function 'cl-struct-foo) :quick-object-witness-check) | ||
| 513 | (should (eq (type-of x) 'foo)) | ||
| 514 | (should (eq (type-of [foo]) 'vector)) | ||
| 515 | |||
| 516 | (cl-old-struct-compat-mode (if saved 1 -1)))) | ||
| 517 | |||
| 518 | (ert-deftest cl-lib-old-struct () | ||
| 519 | (let ((saved cl-old-struct-compat-mode)) | ||
| 520 | (cl-old-struct-compat-mode -1) | ||
| 521 | (cl-struct-define 'foo "" 'cl-structure-object nil nil nil | ||
| 522 | 'cl-struct-foo-tags 'cl-struct-foo t) | ||
| 523 | (should cl-old-struct-compat-mode) | ||
| 524 | (cl-old-struct-compat-mode (if saved 1 -1)))) | ||
| 525 | |||
| 503 | ;;; cl-lib.el ends here | 526 | ;;; cl-lib.el ends here |