File tree Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Original file line number Diff line number Diff line change 21
21
(list x)
22
22
x))
23
23
24
+ (defn- fn-spec-name?
25
+ [s]
26
+ (symbol? s))
27
+
24
28
(defmacro enumerate-namespace
25
29
" Given a symbol naming an ns, or a collection of such symbols,
26
30
returns the set of all symbols naming vars in those nses."
@@ -175,4 +179,16 @@ Returns a collection of syms naming the vars unstrumented."
175
179
([f spec opts]
176
180
`(let [opts# ~opts]
177
181
(validate-check-opts opts#)
178
- (check-1 nil ~f ~spec opts#))))
182
+ (check-1 nil ~f ~spec opts#))))
183
+
184
+ (defmacro checkable-syms
185
+ " Given an opts map as per check, returns the set of syms that
186
+ can be checked."
187
+ ([]
188
+ `(checkable-syms nil ))
189
+ ([opts]
190
+ `(let [opts# ~opts]
191
+ (validate-check-opts opts#)
192
+ (reduce conj #{}
193
+ '[~@(filter fn-spec-name? (keys @s/registry-ref))
194
+ ~@(keys (:spec opts))]))))
Original file line number Diff line number Diff line change @@ -226,15 +226,6 @@ with explain-data + ::s/failure."
226
226
[opts]
227
227
(assert (every? ident? (keys (:gen opts))) " check :gen expects ident keys" ))
228
228
229
- (defn checkable-syms
230
- " Given an opts map as per check, returns the set of syms that
231
- can be checked."
232
- ([] (checkable-syms nil ))
233
- ([opts]
234
- (validate-check-opts opts)
235
- (reduce into #{} [(filter fn-spec-name? (keys (s/registry )))
236
- (keys (:spec opts))])))
237
-
238
229
(defn check
239
230
" Run generative tests for spec conformance on vars named by
240
231
sym-or-syms, a symbol or collection of symbols. If sym-or-syms
@@ -394,6 +385,8 @@ key with a count for each different :type of result."
394
385
(s/fspec
395
386
:args (s/cat :x int?)
396
387
:ret int?))
388
+
389
+ (m/checkable-syms )
397
390
)
398
391
399
392
You can’t perform that action at this time.
0 commit comments