mirror of
https://github.com/metosin/reitit.git
synced 2026-01-25 23:59:04 +00:00
fix interceptor tests
This commit is contained in:
parent
3bdae9db75
commit
872f1dbbc4
1 changed files with 3 additions and 3 deletions
|
|
@ -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]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue