Skip to content

Instantly share code, notes, and snippets.

@brandonbloom
Created February 10, 2017 22:26
Show Gist options
  • Save brandonbloom/5d89fe87cb6fe34844423f9e88939085 to your computer and use it in GitHub Desktop.
Save brandonbloom/5d89fe87cb6fe34844423f9e88939085 to your computer and use it in GitHub Desktop.
(s/def ::m1 (s/keys :req [::a ::b]))
(s/def ::a int?)
(s/def ::b int?)
(s/def ::x int?)
(s/def ::y int?)
(s/def ::ab (s/keys :req [::a ::b]))
(s/def ::xy (s/keys :req [::x ::y]))
(s/def ::m (s/merge ::ab (s/nilable ::xy)))
(s/exercise ::m)
(set (map (comp vec keys first) (s/exercise ::m)))
;; actual => #{[:user/a :user/b :user/x :user/y]}
;; expected => #{[:user/a :user/b]
;; [:user/a :user/b :user/x :user/y]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment