ret-type))))
(cl-eval-when (compile eval load)
+ (cl-defstruct comp-foo a b)
+ (cl-defstruct (comp-bar (:include comp-foo)) c)
(defconst comp-tests-type-spec-tests
;; Why we quote everything here, you ask? So that values of
;; `most-positive-fixnum' and `most-negative-fixnum', which can be
(if (eq x 0)
(error "")
(1+ x)))
- 'number)))
+ 'number)
+
+ ;; 75
+ ((defun comp-tests-ret-type-spec-f ()
+ (make-comp-foo))
+ 'comp-foo)
+
+ ;; 76
+ ((defun comp-tests-ret-type-spec-f ()
+ (make-comp-bar))
+ 'comp-bar)
+
+ ;; 77
+ ((defun comp-tests-ret-type-spec-f (x)
+ (setf (comp-foo-a x) 2)
+ x)
+ 'comp-foo)
+
+ ;; 78
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if x
+ (if (> x 11)
+ x
+ (make-comp-foo))
+ (make-comp-bar)))
+ '(or comp-foo float (integer 12 *)))
+
+ ;; 79
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (comp-foo-p x)
+ x
+ (error "")))
+ 'comp-foo)))
(defun comp-tests-define-type-spec-test (number x)
`(comp-deftest ,(intern (format "ret-type-spec-%d" number)) ()