From 9ab7d3a2f872a5823cf460dcf0d7d0e4041074fe Mon Sep 17 00:00:00 2001 From: Michael Blume Date: Tue, 18 Jul 2017 13:45:12 -0700 Subject: [PATCH] restore function call test using sql/call --- test/honeysql/format_test.cljc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/honeysql/format_test.cljc b/test/honeysql/format_test.cljc index 6b8dad4..338671e 100644 --- a/test/honeysql/format_test.cljc +++ b/test/honeysql/format_test.cljc @@ -115,6 +115,13 @@ :order-by [[:amount :asc]]}) ["SELECT amount, id, created_on FROM transactions UNION SELECT amount, id, created_on FROM (SELECT amount, id, created_on FROM other_transactions ORDER BY amount DESC LIMIT ?) ORDER BY amount ASC" 5])))) +(deftest compare-expressions-test + (testing "sql/call should produce appropriate function calls" + (is (= ["SELECT foo FROM bar WHERE (col1 mod ?) = (col2 + ?)" 4 4] + (format {:select [:foo] + :from [:bar] + :where (sql/call := (sql/call :mod :col1 4) (sql/call :+ :col2 4))}))))) + (deftest union-with-cte (is (= (format {:union [{:select [:foo] :from [:bar1]} {:select [:foo] :from [:bar2]}]