From a0b73cdcc6c640f40c1520cec5308943db37d711 Mon Sep 17 00:00:00 2001 From: Michael Blume Date: Mon, 17 Jul 2017 20:24:15 -0700 Subject: [PATCH] Test that tuples work correctly Thanks to @jetmind who gave this test in #168 --- test/honeysql/format_test.cljc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/honeysql/format_test.cljc b/test/honeysql/format_test.cljc index d2b7615..6b8dad4 100644 --- a/test/honeysql/format_test.cljc +++ b/test/honeysql/format_test.cljc @@ -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]]}))))