emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 1ef219e220c 4/4: Make old-struct test more robust


From: Mattias Engdegård
Subject: master 1ef219e220c 4/4: Make old-struct test more robust
Date: Fri, 5 May 2023 16:01:33 -0400 (EDT)

branch: master
commit 1ef219e220c9645a5592eb73837aba8d50e4265c
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    Make old-struct test more robust
    
    * test/lisp/emacs-lisp/cl-lib-tests.el (old-struct):
    Use the `vector` constructor instead of vector literals to
    avoid failing because of `type-of` constant-folding.
---
 test/lisp/emacs-lisp/cl-lib-tests.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el 
b/test/lisp/emacs-lisp/cl-lib-tests.el
index 4e1a0fd63a2..b14731c4d0a 100644
--- a/test/lisp/emacs-lisp/cl-lib-tests.el
+++ b/test/lisp/emacs-lisp/cl-lib-tests.el
@@ -530,7 +530,7 @@
 
 (ert-deftest old-struct ()
   (cl-defstruct foo x)
-  (let ((x [cl-struct-foo])
+  (let ((x (vector 'cl-struct-foo))
         (saved cl-old-struct-compat-mode))
     (cl-old-struct-compat-mode -1)
     (should (eq (type-of x) 'vector))
@@ -540,7 +540,7 @@
     (let ((cl-struct-foo (cl--struct-get-class 'foo)))
       (setf (symbol-function 'cl-struct-foo) :quick-object-witness-check)
       (should (eq (type-of x) 'foo))
-      (should (eq (type-of [foo]) 'vector)))
+      (should (eq (type-of (vector 'foo)) 'vector)))
 
     (cl-old-struct-compat-mode (if saved 1 -1))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]