File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 68
68
[k spec-form]
69
69
(let [k (if (symbol? k) (ns-qualify &env k) k)
70
70
form (res &env spec-form)]
71
- (swap! registry-ref assoc k form)
71
+ (swap! registry-ref (fn [r]
72
+ (if (nil? form)
73
+ (dissoc r k)
74
+ (assoc r k form))))
72
75
`(def-impl '~k '~form ~spec-form)))
73
76
74
77
(defmacro spec
Original file line number Diff line number Diff line change 186
186
(is (= [2 3 ] (next [1 2 3 ])))
187
187
(is (thrown-with-msg? js/Error #"Call to #'cljs.core/next did not conform to spec\. " (next 1 )))
188
188
(is (= '[cljs.core/next] (stest/unstrument `next))))
189
+
190
+ (defn cljs-3049 [x] x )
191
+ (deftest test-3049
192
+ (s/fdef cljs-3049 :args (s/cat :x number?) :ret number?)
193
+ (testing " the spec'ed fn is checkable"
194
+ (is (contains? (stest/checkable-syms ) `cljs-3049)))
195
+ (s/def cljs-3049 nil )
196
+ (testing " the spec'ed fn is not checkable anymore"
197
+ (is (not (contains? (stest/checkable-syms ) `cljs-3049)))))
You can’t perform that action at this time.
0 commit comments