Fork me on GitHub
#clojure-spec
<
2017-02-11
>
triss12:02:13

ok this is a long shot I think but just double checking...

triss12:02:31

so i’ve got a vector of vectors

triss12:02:37

and i want to ensure that the integers within it are no greater than the number of vectors in the outer one

triss12:02:11

can i say this with spec?

triss12:02:59

(s/coll-of (s/coll-of (s/and int? #(>= % 0))
                        :kind vector?
                        :count 8)
             :kind vector?
             :min-count 2)

triss12:02:14

is there a way of referencing the size of the outer vector here?

dergutemoritz13:02:04

@triss Only by wrapping the check around the outer s/coll-of with s/and AFAICT

triss13:02:51

@dergutemoritz thanks man. just realized this!

Yehonathan Sharvit18:02:25

What is the proper way to integrate spec.test/check with clojure.test?

zane05:02:15

See the pinned items in this channel.

Yehonathan Sharvit08:02:27

It’s not clear from the guide how to use spec inside deftest