File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 261
261
(throw+ (str " Can't construct empty " (class form))))
262
262
`(into ~(empty form) [] ~(vec wrappee))))]
263
263
(d/tprn " :wrapped" (class form) (class wrapped) wrapped)
264
- (f line (add-original form wrapped))))
264
+ (f line (vary-meta wrapped merge ( meta form) ))))
265
265
266
266
(defn wrap-fn-body [f line form]
267
267
(let [fn-sym (first form)
Original file line number Diff line number Diff line change 180
180
form))]
181
181
(t/is (:preserved? (meta instrumented)))))
182
182
183
+ (def test-coll-is-evaluated-once-count
184
+ " This needs to be reachable from global scope."
185
+ (atom 0 ))
186
+
187
+ (t/deftest test-coll-is-evaluated-once
188
+ (reset! test-coll-is-evaluated-once-count 0 )
189
+ (inst/instrument-form #'inst/no-instr nil `{:foo (swap! test-coll-is-evaluated-once-count inc)})
190
+ (t/is (= 1 @test-coll-is-evaluated-once-count)))
191
+
183
192
(t/deftest fail-gracefully-when-instrumenting
184
193
(t/testing " If instrumenting a form fails we should log an Exception and continue instead of failing entirely."
185
194
(let [form '(this-function-does-not-exist 100 )
You can’t perform that action at this time.
0 commit comments