Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
frenchy64 committed Oct 24, 2024
1 parent 6d82f01 commit e03fdba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/flanders/spec.clj
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,16 @@

EitherType
(->spec' [{:keys [tests choices]} ns f]
(when (seq tests)
(throw (ex-info (str "WARNING: "))))
(let [choices (->> choices
(map-indexed
(fn [i c]
(let [label (str "choice" i)
spec (f c (str ns "." label))]
(eval `(s/def ~(keyword ns label) ~spec))
(prn spec)
(eval `(s/def ~(keyword ns label) ~(if-some [t (nth tests i nil)]
;;hmm this doesn't s/exercise
`(s/and ~spec ~t)
spec)))
(assoc c
:label (keyword label)
:spec spec)))))
Expand Down

0 comments on commit e03fdba

Please sign in to comment.