From c8f647ea26158f034f42839032ca61ff3d16f963 Mon Sep 17 00:00:00 2001 From: Mike Blume Date: Tue, 24 Feb 2015 14:35:44 -0800 Subject: [PATCH] simple format tests --- test/honeysql/format_test.clj | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/honeysql/format_test.clj diff --git a/test/honeysql/format_test.clj b/test/honeysql/format_test.clj new file mode 100644 index 0000000..19483ef --- /dev/null +++ b/test/honeysql/format_test.clj @@ -0,0 +1,19 @@ +(ns honeysql.format-test + (:refer-clojure :exclude [format]) + (:require [clojure.test :refer [deftest testing is are]] + [honeysql.format :refer :all])) + +(deftest test-quote + (are + [qx res] + (= (apply quote-identifier "foo.bar.baz" qx) res) + [] "foo.bar.baz" + [:style :mysql] "`foo`.`bar`.`baz`" + [:style :mysql :split false] "`foo.bar.baz`") + (are + [x res] + (= (quote-identifier x) res) + 3 "3" + 'foo "foo" + :foo-bar "foo_bar") + (is (= (quote-identifier "*" :style :ansi) "*")))