summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2023-05-04 17:47:05 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2023-05-05 22:00:28 +0200
commit1ef219e220c9645a5592eb73837aba8d50e4265c (patch)
treeac8e2ee9e7a156c325d27bae8880b36410c7f01e /test
parent044392c5c563a0bb2c24b65e5222b8f9b3cbe0d8 (diff)
downloademacs-1ef219e220c9645a5592eb73837aba8d50e4265c.tar.gz
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.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/cl-lib-tests.el4
1 files 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))))