From 6d0ff344b909c8ee86eb06a97eacc84a88ce9593 Mon Sep 17 00:00:00 2001 From: Dave Della Costa Date: Mon, 9 Mar 2015 13:21:41 +0900 Subject: [PATCH] Adds basic tests for PR #34, common table expressions --- test/honeysql/format_test.clj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/honeysql/format_test.clj b/test/honeysql/format_test.clj index 19483ef..6a9fef9 100644 --- a/test/honeysql/format_test.clj +++ b/test/honeysql/format_test.clj @@ -17,3 +17,11 @@ 'foo "foo" :foo-bar "foo_bar") (is (= (quote-identifier "*" :style :ansi) "*"))) + +(deftest test-cte + (is (= (format-clause + (first {:with [[:query {:select [:foo] :from [:bar]}]]}) nil) + "WITH query AS SELECT foo FROM bar")) + (is (= (format-clause + (first {:with-recursive [[:query {:select [:foo] :from [:bar]}]]}) nil) + "WITH RECURSIVE query AS SELECT foo FROM bar")))