From 5e7e224df462027025f534dd5a9ecb0acb3b0054 Mon Sep 17 00:00:00 2001 From: Joost Diepenmaat Date: Fri, 17 Feb 2017 10:20:40 +0100 Subject: [PATCH] Show problem with operators in value positions --- 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 5e140dc..ccf1efb 100644 --- a/test/honeysql/format_test.cljc +++ b/test/honeysql/format_test.cljc @@ -110,3 +110,10 @@ :limit 5}]}] :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 "Sequences should be fns when in value/comparison spots" + (is (= ["SELECT foo FROM bar WHERE (col1 mod ?) = (col2 + ?)" 4 4] + (format {:select [:foo] + :from [:bar] + :where [:= [:mod :col1 4] [:+ :col2 4]]})))))