Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn- dependency-indices
- [length]
- (s/tuple (s/int-in 0 length)
- (s/int-in 0 length)))
- (defn- index-set
- [length]
- (s/gen (s/coll-of (dependency-indices length)
- :kind set?
- :max-count (/ length 2))))
- (s/def ::tasks
- (s/spec (s/coll-of ::task)
- :gen (fn []
- (gen/bind
- (s/gen (s/coll-of ::task :min-count 5))
- (fn [tasks]
- ;; If we remove the gen/tuple - just make it (gen/return tasks), it runs
- ;; fast. With the gen/tuple, it says "Couldn't satisfy such-that" consisitently
- (gen/tuple (gen/return tasks)))))))
- (s/def ::task (s/keys :req [:task.def2/uuid
- :task.def2/name]))
- (s/def :task.def2/uuid uuid?)
- (s/def :task.def2/name (s/and string? not-empty))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement