Commit c0b3b35d authored by Raymond Toy's avatar Raymond Toy

Merge branch 'defstruct-new' into 'master'

Defstruct tests for predicate, type and named combinations

See merge request !7
parents 87c8f24a 66fcf657
...@@ -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,21 @@ ...@@ -495,3 +504,21 @@
(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)
;;; If named option is supplied, then 0th element is vector type (a
;;; symbol), not the 1st one.
(deftest defstruct.error.4
(signals-error
(eval (read-from-string
"(defstruct (struct-test.error.4 (:type (vector single-float))
(:predicate struct-test.error.4)
:named))"))
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