Skip to content

Commit 052d45e

Browse files
author
dnolen
committed
tweaks verify that instrumentable syms works
1 parent 212fb9d commit 052d45e

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/main/cljs/cljs/spec/test.cljc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ invokes the fn you provide, enabling arbitrary stubbing and mocking.
9696
Returns a collection of syms naming the vars instrumented."
9797
([]
9898
`(instrument (instrumentable-syms)))
99-
([sym-or-syms]
100-
`(instrument ~sym-or-syms nil))
101-
([sym-or-syms opts]
99+
([xs]
100+
`(instrument ~xs nil))
101+
([[quote sym-or-syms] opts]
102102
`(let [opts# ~opts]
103103
(reduce
104104
(fn [ret [_ f]]
@@ -109,7 +109,7 @@ Returns a collection of syms naming the vars instrumented."
109109
(collectionize ~sym-or-syms)
110110
~@(map
111111
(fn [sym]
112-
`(fn [] (instrument-1 ~sym opts#)))
112+
`(fn [] (instrument-1 '~sym opts#)))
113113
(collectionize ~sym-or-syms)))
114114
(filter #((instrumentable-syms opts#) (first %)))
115115
(distinct-by first))))))

src/main/cljs/cljs/spec/test.cljs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ Returns a map as quick-check, with :explain-data added if
246246
'[cljs.spec.impl.gen :as gen]
247247
'[cljs.test :as ctest])
248248

249-
(require :reload '[cjls.spec.test :as test])
249+
(require :reload '[cljs.spec.test :as test])
250250

251251
;; discover speced vars for your own test runner
252252
(s/speced-vars)
@@ -278,6 +278,8 @@ Returns a map as quick-check, with :explain-data added if
278278
:fn (s/and #(>= (:ret %) (-> % :args :start))
279279
#(< (:ret %) (-> % :args :end))))
280280

281+
(instrumentable-syms)
282+
281283
(m/instrument-1 ranged-rand {})
282284
(ranged-rand 8 5)
283285
(defn foo

0 commit comments

Comments
 (0)