File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,12 @@ returns the set of all symbols naming vars in those nses."
4646(defmacro with-instrument-disabled
4747 " Disables instrument's checking of calls, within a scope."
4848 [& body]
49- `(binding [*instrument-enabled* nil ]
50- ~@body))
49+ `(let [orig# @#'*instrument-enabled*]
50+ (set! *instrument-enabled* nil )
51+ (try
52+ ~@body
53+ (finally
54+ (set! *instrument-enabled* orig#)))))
5155
5256(defmacro instrument-1
5357 [[quote s] opts]
Original file line number Diff line number Diff line change 9797 (stest/enumerate-namespace 'cljs.spec.test.test-ns1)))
9898 (is (= '#{cljs.spec.test.test-ns2/z}
9999 (stest/enumerate-namespace 'cljs.spec.test.test-ns2))))
100+
101+ (defn fn-2953 [x] ::ret-val )
102+
103+ (s/fdef fn-2953 :args (s/cat :x int?))
104+
105+ (deftest test-cljs-2953
106+ (stest/instrument `fn-2953)
107+ (is @#'stest/*instrument-enabled*)
108+ (is (= ::ret-val (stest/with-instrument-disabled
109+ (is (nil? @#'stest/*instrument-enabled*))
110+ (fn-2953 " abc" ))))
111+ (is @#'stest/*instrument-enabled*))
You can’t perform that action at this time.
0 commit comments