File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,3 +139,13 @@ Returns a collection of syms naming the vars unstrumented."
139139 `(fn []
140140 (unstrument-1 '~sym)))))
141141 (remove nil?))]))))
142+
143+ ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; testing ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
144+
145+ (defmacro sym->check-map
146+ [[quote s]]
147+ (if-let [{:keys [name] :as v} (ana-api/resolve &env s)]
148+ `{:s '~s
149+ :v (var ~name)
150+ :spec (s/get-spec (var ~name))}
151+ `{:s '~s}))
Original file line number Diff line number Diff line change @@ -242,13 +242,6 @@ with explain-data + ::s/failure."
242242 (finally
243243 (when re-inst? (instrument s))))))
244244
245- (defn- sym->check-map
246- [s]
247- (let [v (resolve s)]
248- {:s s
249- :v v
250- :spec (when v (s/get-spec v))}))
251-
252245(defn- validate-check-opts
253246 [opts]
254247 (assert (every? ident? (keys (:gen opts))) " check :gen expects ident keys" ))
@@ -422,6 +415,8 @@ key with a count for each different :type of result."
422415 (ranged-rand 8 5 )))
423416 (foo 1 2 )
424417 (m/unstrument-1 ranged-rand)
418+
419+ (m/sym->check-map 'ranged-rand)
425420 )
426421
427422
You can’t perform that action at this time.
0 commit comments