diff options
| author | Earl Hyatt | 2025-03-29 17:30:48 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2025-03-31 14:34:28 -0400 |
| commit | 6f311883d246df87fa3ed9c24dbb39078e3fd69f (patch) | |
| tree | 008e1f97ebebd91fa7cc05047e5153b497f7a707 /test | |
| parent | e04d1dafc700813c835ae4e45af4e104c49e8875 (diff) | |
| download | emacs-6f311883d246df87fa3ed9c24dbb39078e3fd69f.tar.gz emacs-6f311883d246df87fa3ed9c24dbb39078e3fd69f.zip | |
Fix typo in test of read-only cl-defstruct slot.
* test/lisp/emacs-lisp/cl-macs-tests.el (mystruct)
(cl-lib-struct-accessors): Use ":read-only" instead of ":readonly".
* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-struct-accessors):
Test using `setf' on read-only accessor to make sure the correct keyword
is used.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/cl-macs-tests.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el index ed6b1c2e4d4..3e3279ee35a 100644 --- a/test/lisp/emacs-lisp/cl-macs-tests.el +++ b/test/lisp/emacs-lisp/cl-macs-tests.el | |||
| @@ -520,7 +520,7 @@ collection clause." | |||
| 520 | (:constructor cl-lib--con-1 (&aux (abc 1))) | 520 | (:constructor cl-lib--con-1 (&aux (abc 1))) |
| 521 | (:constructor cl-lib--con-2 (&optional def) "Constructor docstring.")) | 521 | (:constructor cl-lib--con-2 (&optional def) "Constructor docstring.")) |
| 522 | "General docstring." | 522 | "General docstring." |
| 523 | (abc 5 :readonly t) (def nil)) | 523 | (abc 5 :read-only t) (def nil)) |
| 524 | 524 | ||
| 525 | (ert-deftest cl-lib-struct-accessors () | 525 | (ert-deftest cl-lib-struct-accessors () |
| 526 | (let ((x (make-mystruct :abc 1 :def 2))) | 526 | (let ((x (make-mystruct :abc 1 :def 2))) |
| @@ -530,8 +530,9 @@ collection clause." | |||
| 530 | (should (eql (cl-struct-slot-value 'mystruct 'def x) -1)) | 530 | (should (eql (cl-struct-slot-value 'mystruct 'def x) -1)) |
| 531 | (should (eql (cl-struct-slot-offset 'mystruct 'abc) 1)) | 531 | (should (eql (cl-struct-slot-offset 'mystruct 'abc) 1)) |
| 532 | (should-error (cl-struct-slot-offset 'mystruct 'marypoppins)) | 532 | (should-error (cl-struct-slot-offset 'mystruct 'marypoppins)) |
| 533 | (should-error (setf (mystruct-abc x) 3)) | ||
| 533 | (should (pcase (cl-struct-slot-info 'mystruct) | 534 | (should (pcase (cl-struct-slot-info 'mystruct) |
| 534 | (`((cl-tag-slot) (abc 5 :readonly t) | 535 | (`((cl-tag-slot) (abc 5 :read-only t) |
| 535 | (def . ,(or 'nil '(nil)))) | 536 | (def . ,(or 'nil '(nil)))) |
| 536 | t))))) | 537 | t))))) |
| 537 | 538 | ||