File tree 2 files changed +18
-2
lines changed
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."
46
46
(defmacro with-instrument-disabled
47
47
" Disables instrument's checking of calls, within a scope."
48
48
[& 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#)))))
51
55
52
56
(defmacro instrument-1
53
57
[[quote s] opts]
Original file line number Diff line number Diff line change 97
97
(stest/enumerate-namespace 'cljs.spec.test.test-ns1)))
98
98
(is (= '#{cljs.spec.test.test-ns2/z}
99
99
(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