]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix typo in test of read-only cl-defstruct slot.
authorEarl Hyatt <okamsn@protonmail.com>
Sat, 29 Mar 2025 21:30:48 +0000 (17:30 -0400)
committerEshel Yaron <me@eshelyaron.com>
Thu, 3 Apr 2025 16:49:17 +0000 (18:49 +0200)
* 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.

(cherry picked from commit 6f311883d246df87fa3ed9c24dbb39078e3fd69f)

test/lisp/emacs-lisp/cl-macs-tests.el

index df612c11a096a927666cbbe01ab09a5a1bf9a9f0..18eb386df2ccf7e63cd3bb5a849a6cd3410d98c2 100644 (file)
@@ -520,7 +520,7 @@ collection clause."
                (:constructor cl-lib--con-1 (&aux (abc 1)))
                (:constructor cl-lib--con-2 (&optional def) "Constructor docstring."))
   "General docstring."
-  (abc 5 :readonly t) (def nil))
+  (abc 5 :read-only t) (def nil))
 
 (ert-deftest cl-lib-struct-accessors ()
   (let ((x (make-mystruct :abc 1 :def 2)))
@@ -530,8 +530,9 @@ collection clause."
     (should (eql (cl-struct-slot-value 'mystruct 'def x) -1))
     (should (eql (cl-struct-slot-offset 'mystruct 'abc) 1))
     (should-error (cl-struct-slot-offset 'mystruct 'marypoppins))
+    (should-error (setf (mystruct-abc x) 3))
     (should (pcase (cl-struct-slot-info 'mystruct)
-              (`((cl-tag-slot) (abc 5 :readonly t)
+              (`((cl-tag-slot) (abc 5 :read-only t)
                  (def . ,(or 'nil '(nil))))
                t)))))