Add moar bindings
This commit is contained in:
parent
5d95bb9c45
commit
91782b4f3a
2 changed files with 9 additions and 5 deletions
|
|
@ -79,7 +79,11 @@
|
||||||
'nilable-impl (copy-var s/nilable-impl sns)
|
'nilable-impl (copy-var s/nilable-impl sns)
|
||||||
'nonconforming (copy-var s/nonconforming sns)
|
'nonconforming (copy-var s/nonconforming sns)
|
||||||
'get-spec (copy-var s/get-spec sns)
|
'get-spec (copy-var s/get-spec sns)
|
||||||
'exercise (copy-var s/exercise sns)})
|
'exercise (copy-var s/exercise sns)
|
||||||
|
'merge (copy-var s/merge sns)
|
||||||
|
'merge-spec-impl (copy-var s/merge-spec-impl sns)
|
||||||
|
'keys* (copy-var s/keys* sns)
|
||||||
|
'with-gen (copy-var s/with-gen sns)})
|
||||||
|
|
||||||
#_:clj-kondo/ignore
|
#_:clj-kondo/ignore
|
||||||
(def test-namespace
|
(def test-namespace
|
||||||
|
|
|
||||||
|
|
@ -512,7 +512,7 @@
|
||||||
specs. Unlike 'and', merge can generate maps satisfying the
|
specs. Unlike 'and', merge can generate maps satisfying the
|
||||||
union of the predicates."
|
union of the predicates."
|
||||||
[& pred-forms]
|
[& pred-forms]
|
||||||
`(merge-spec-impl '~(mapv res pred-forms) ~(vec pred-forms) nil))
|
`(clojure.spec.alpha/merge-spec-impl '~(mapv res pred-forms) ~(vec pred-forms) nil))
|
||||||
|
|
||||||
(defn- res-kind
|
(defn- res-kind
|
||||||
[opts]
|
[opts]
|
||||||
|
|
@ -1813,9 +1813,9 @@
|
||||||
user=> (s/conform (s/cat :i1 integer? :m (s/keys* :req-un [::a ::c]) :i2 integer?) [42 :a 1 :c 2 :d 4 99])
|
user=> (s/conform (s/cat :i1 integer? :m (s/keys* :req-un [::a ::c]) :i2 integer?) [42 :a 1 :c 2 :d 4 99])
|
||||||
{:i1 42, :m {:a 1, :c 2, :d 4}, :i2 99}"
|
{:i1 42, :m {:a 1, :c 2, :d 4}, :i2 99}"
|
||||||
[& kspecs]
|
[& kspecs]
|
||||||
`(let [mspec# (keys ~@kspecs)]
|
`(let [mspec# (clojure.spec.alpha/keys ~@kspecs)]
|
||||||
(with-gen (clojure.spec.alpha/& (* (cat ::k keyword? ::v any?)) ::kvs->map mspec#)
|
(clojure.spec.alpha/with-gen (clojure.spec.alpha/& (clojure.spec.alpha/* (clojure.spec.alpha/cat ::k keyword? ::v any?)) ::kvs->map mspec#)
|
||||||
(fn [] (clojure.spec.gen.alpha/fmap (fn [m#] (apply concat m#)) (gen mspec#))))))
|
(fn [] (clojure.spec.gen.alpha/fmap (fn [m#] (apply concat m#)) (clojure.spec.alpha/gen mspec#))))))
|
||||||
|
|
||||||
(defn ^:skip-wiki nonconforming
|
(defn ^:skip-wiki nonconforming
|
||||||
"takes a spec and returns a spec that has the same properties except
|
"takes a spec and returns a spec that has the same properties except
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue