proxy [ThreadLocal] via thread-parameter; clojure.test/*testing-vars*
- (proxy [ThreadLocal] [] (initialValue [] body)) now builds a real per-thread store backed by a Chez thread-parameter, with a lazy initialValue; .get/.set/ .remove work. Other proxies stay nil. test.check's no-seed PRNG (next-rng) uses one, so gen/sample and gen/generate (and everything built on them) now work. - clojure.test/*testing-vars* (+ *report-counters*) are bound vars now, so a defspec run through its :test metadata / default reporter doesn't hit an unbound var. make test green (+1 corpus row), shakesmoke byte-identical. One re-mint (proxy).
This commit is contained in:
parent
f32bd335e3
commit
4d61145e9c
6 changed files with 587 additions and 558 deletions
|
|
@ -22,6 +22,12 @@
|
|||
(def once-fixtures (atom []))
|
||||
(def each-fixtures (atom []))
|
||||
|
||||
;; clojure.test/*testing-vars* — the stack of vars under test. Real clojure.test
|
||||
;; binds it around each test var; test.check's default reporter reads it, so a
|
||||
;; defspec run through its :test metadata doesn't blow up on an unbound var.
|
||||
(def ^:dynamic *testing-vars* (list))
|
||||
(def ^:dynamic *report-counters* nil)
|
||||
|
||||
(defn reset-report! []
|
||||
(reset! counters {:test 0 :pass 0 :fail 0 :error 0 :fails []})
|
||||
(reset! ctx-stack [])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue