Skip to content
Snippets Groups Projects
Commit 7c96dd9c authored by pfdietz's avatar pfdietz
Browse files

Add base-string, simple-base-string, sequence types to make-random-type-containing

parent 57c0c407
No related branches found
No related tags found
No related merge requests found
...@@ -366,14 +366,22 @@ ...@@ -366,14 +366,22 @@
(1 `(,root ,etype ,(loop for i below rank collect (make-random-array-dimension-spec val i)))) (1 `(,root ,etype ,(loop for i below rank collect (make-random-array-dimension-spec val i))))
(1 `(,root ,etype ,(loop for i below rank collect (array-dimension val i)))) (1 `(,root ,etype ,(loop for i below rank collect (array-dimension val i))))
#-ecl (1 `(,root ,etype ,rank)) #-ecl (1 `(,root ,etype ,rank))
(4 (call-next-method))
))) )))
(defmethod make-random-type-containing ((val string)) (defmethod make-random-type-containing ((val string))
(rcase (rcase
(1 (let ((root (if (and (coin) (1 (let ((root (cond
(typep val 'simple-string)) ((and (coin)
'simple-string (typep val 'base-string))
'string))) (cond
((and (coin) (typep val 'simple-base-string))
'simple-base-string)
(t 'base-string)))
((and (coin)
(typep val 'simple-string))
'simple-string)
(t 'string))))
(rcase (1 root) (rcase (1 root)
(1 `(,root)) (1 `(,root))
(3 `(,root ,(make-random-array-dimension-spec val 0)))))) (3 `(,root ,(make-random-array-dimension-spec val 0))))))
...@@ -426,6 +434,11 @@ ...@@ -426,6 +434,11 @@
'function)) 'function))
(1 t))) (1 t)))
(defmethod make-random-type-containing ((val sequence))
(rcase
(1 'sequence)
(2 (call-next-method))))
;;; Macro for defining random type prop tests ;;; Macro for defining random type prop tests
(defmacro def-type-prop-test (name &body args) (defmacro def-type-prop-test (name &body args)
......
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