Skip to content
Snippets Groups Projects
Commit 31666834 authored by Daniel Kochmański's avatar Daniel Kochmański
Browse files

defstruct: add tests for predicate, type and named combination

parent 87c8f24a
No related branches found
No related tags found
No related merge requests found
...@@ -485,6 +485,15 @@ ...@@ -485,6 +485,15 @@
(defstruct-with-tests (struct-test-68 (:include struct-test-67)) (defstruct-with-tests (struct-test-68 (:include struct-test-67))
c d) 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 ;;; Error tests
(deftest copy-structure.error.1 (deftest copy-structure.error.1
...@@ -495,3 +504,10 @@ ...@@ -495,3 +504,10 @@
(signals-error (copy-structure (make-s-2) nil) program-error) (signals-error (copy-structure (make-s-2) nil) program-error)
t) 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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment