verify cache entries based on varying parameter names
This commit is contained in:
parent
06102e9334
commit
33ddaa74b6
1 changed files with 13 additions and 1 deletions
|
|
@ -77,4 +77,16 @@
|
|||
{:params {:id 2}})
|
||||
(sut/format {:select [:*] :from [:table] :where [:= :id :?id]}
|
||||
{:cache cache :params {:id 2}})))
|
||||
(is (= 1 (cache-size cache)))))
|
||||
(is (= 1 (cache-size cache)))
|
||||
;; different parameter names create different cache entries:
|
||||
(is (= (sut/format {:select [:*] :from [:table] :where [:= :id :?x]}
|
||||
{:cache cache :params {:x 2}})
|
||||
(sut/format {:select [:*] :from [:table] :where [:= :id :?y]}
|
||||
{:cache cache :params {:y 2}})))
|
||||
(is (= 3 (cache-size cache)))
|
||||
;; swapping parameter names creates different cache entries:
|
||||
(is (= (sut/format {:select [:*] :from [:table] :where [:and [:= :id :?x] [:= :foo :?y]]}
|
||||
{:cache cache :params {:x 2 :y 3}})
|
||||
(sut/format {:select [:*] :from [:table] :where [:and [:= :id :?y] [:= :foo :?x]]}
|
||||
{:cache cache :params {:x 3 :y 2}})))
|
||||
(is (= 5 (cache-size cache)))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue