add test for #515

This commit is contained in:
Sean Corfield 2023-12-03 17:17:28 -08:00
parent 1e44f82eb5
commit 2e8157047d

View file

@ -1293,6 +1293,22 @@ ORDER BY id = ? DESC
(is (= ["SELECT DISTINCT * FROM table"]
(sut/format {:select ^:distinct [:*] :from [:table]})))))
(deftest issue-515
(testing ":always-quoting option"
(is (= ["SELECT foo FROM table"]
(sut/format '{select foo from table})))
(is (= ["SELECT \"foo\" FROM \"table\""]
(sut/format '{select foo from table}
{:quoted-always #"^(foo|table)$"})))
(is (= ["SELECT \"foo\" FROM \"table\""]
(sut/format '{select foo from table}
{:quoted-always #"^(foo|table)$"
:quoted false})))
(is (= ["SELECT \"foo\" FROM table"]
(sut/format '{select foo from table}
{:quoted-always #"^(foo)$"
:quoted false})))))
(comment
;; partial workaround for #407:
(sut/format {:select :f.* :from [[:foo [:f :for :system-time]]] :where [:= :f.id 1]})