fix interceptor tests

This commit is contained in:
Tommi Reiman 2018-09-07 23:35:55 +03:00
parent 3bdae9db75
commit 872f1dbbc4

View file

@ -111,21 +111,21 @@
(let [app (create [[i1 :value]])] (let [app (create [[i1 :value]])]
(dotimes [_ 10] (dotimes [_ 10]
(is (= [:data :value :ok] (app ctx))) (is (= [:data :value :ok] (app ctx)))
(is (= 2 @calls))))) (is (= 1 @calls)))))
(testing "as interceptor" (testing "as interceptor"
(reset! calls 0) (reset! calls 0)
(let [app (create [(i1 :value)])] (let [app (create [(i1 :value)])]
(dotimes [_ 10] (dotimes [_ 10]
(is (= [:data :value :ok] (app ctx))) (is (= [:data :value :ok] (app ctx)))
(is (= 2 @calls))))) (is (= 1 @calls)))))
(testing "deeply compiled interceptor" (testing "deeply compiled interceptor"
(reset! calls 0) (reset! calls 0)
(let [app (create [[i3 :value]])] (let [app (create [[i3 :value]])]
(dotimes [_ 10] (dotimes [_ 10]
(is (= [:data :value :ok] (app ctx))) (is (= [:data :value :ok] (app ctx)))
(is (= 4 @calls))))) (is (= 3 @calls)))))
(testing "too deeply compiled interceptor fails" (testing "too deeply compiled interceptor fails"
(binding [interceptor/*max-compile-depth* 2] (binding [interceptor/*max-compile-depth* 2]