Test that tuples work correctly

Thanks to @jetmind who gave this test in #168
This commit is contained in:
Michael Blume 2017-07-17 20:24:15 -07:00
parent 62c4760c6a
commit a0b73cdcc6

View file

@ -129,3 +129,9 @@
:with [[[:bar {:columns [:spam :eggs]}]
{:values [[1 2] [3 4] [5 6]]}]]})
["WITH bar (spam, eggs) AS (VALUES (?, ?), (?, ?), (?, ?)) SELECT foo FROM bar1 UNION ALL SELECT foo FROM bar2" 1 2 3 4 5 6])))
(deftest format-tuples
(is (= ["SELECT id FROM table WHERE (a, b) = (?, ?)" 1 2]
(format {:select [:id]
:from [:table]
:where [:= [:a :b] [1 2]]}))))