Commit 31666834 authored by Daniel Kochmanski's avatar Daniel Kochmanski

defstruct: add tests for predicate, type and named combination

For details see CLHS and:
https://gitlab.com/embeddable-common-lisp/ecl/issues/385
parent 87c8f24a
......@@ -485,6 +485,15 @@
(defstruct-with-tests (struct-test-68 (:include struct-test-67))
c d)
;;; Structure isn't named, but type is specified. No predicate is
;;; allowed *or* predicate must be NIL.
(defstruct-with-tests (struct-test-69 (:type (vector single-float))
(:predicate nil)))
(defstruct-with-tests (struct-test-70 (:type list)
(:predicate struct-test-70)
:named))
;;; Error tests
(deftest copy-structure.error.1
......@@ -495,3 +504,10 @@
(signals-error (copy-structure (make-s-2) nil) program-error)
t)
(deftest defstruct.error.3
(signals-error
(eval (read-from-string
"(defstruct (struct-test.error.3 (:type (vector single-float))
(:predicate struct-test.error.3)))"))
simple-error)
t)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment