File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 462
462
([sym n]
463
463
`(exercise-fn ~sym ~n nil ))
464
464
([sym n fspec]
465
- `(let [fspec# ~(if-not fspec
466
- `(cljs.spec/get-spec '~(:name (resolve &env sym)))
467
- fspec)
468
- f# ~sym]
469
- (for [args# (gen/sample (gen (:args fspec#)) ~n)]
470
- [args# (apply f# args#)]))))
465
+ (let [sym (cond-> sym
466
+ (clojure.core/and (sequential? sym)
467
+ (= (first sym) 'quote))
468
+ second)]
469
+ `(let [fspec# ~(if-not fspec
470
+ `(cljs.spec/get-spec '~(:name (resolve &env sym)))
471
+ fspec)
472
+ f# ~sym]
473
+ (for [args# (gen/sample (gen (:args fspec#)) ~n)]
474
+ [args# (apply f# args#)])))))
471
475
472
476
(defmacro ^:private init-compile-asserts []
473
477
(let [compile-asserts (not (-> env/*compiler* deref :options :elide-asserts ))]
Original file line number Diff line number Diff line change 70
70
(deftest test-cljs-1754
71
71
(is (boolean? (gen/generate (s/gen boolean?)))))
72
72
73
+ (s/fdef cljs-1757-x :args (s/cat ::first number?) :ret #(= % 2 ))
74
+ (defn cljs-1757-x [b] 2 )
75
+
76
+ (deftest test-cljs-1757
77
+ (is (s/exercise-fn `cljs-1757-x)))
78
+
73
79
; ; Copied from Clojure spec tests
74
80
75
81
(def even-count? #(even? (count %)))
You can’t perform that action at this time.
0 commit comments