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")))