fix #387 properly

This commit is contained in:
Sean Corfield 2022-02-22 21:27:10 -08:00
parent beedc35a22
commit f711b934fa
3 changed files with 11 additions and 1 deletions

View file

@ -1,5 +1,8 @@
# Changes # Changes
* 2.2.next in progress
* Fix [#387](https://github.com/seancorfield/honeysql/issues/387) again.
* 2.2.868 -- 2022-02-21 * 2.2.868 -- 2022-02-21
* Address [#387](https://github.com/seancorfield/honeysql/issues/387) by making the function simpler. * Address [#387](https://github.com/seancorfield/honeysql/issues/387) by making the function simpler.
* Fix [#385](https://github.com/seancorfield/honeysql/issues/385) by quoting inlined UUIDs. * Fix [#385](https://github.com/seancorfield/honeysql/issues/385) by quoting inlined UUIDs.

View file

@ -159,7 +159,7 @@
Hyphens at the start or end of a string should not be touched." Hyphens at the start or end of a string should not be touched."
[s] [s]
(str/replace s #"(\w)-(\w)" "$1 $2")) (str/replace s #"(\w)-(?=\w)" "$1 "))
(defn- namespace-_ (defn- namespace-_
"Return the namespace portion of a symbol, with dashes converted." "Return the namespace portion of a symbol, with dashes converted."

View file

@ -868,6 +868,13 @@ ORDER BY id = ? DESC
{:dialect :sqlserver}))))) {:dialect :sqlserver})))))
(deftest sql-kw-test (deftest sql-kw-test
(is (= "-" (sut/sql-kw :-)))
(is (= "-X" (sut/sql-kw :-x)))
(is (= "X-" (sut/sql-kw :x-)))
(is (= "-X-" (sut/sql-kw :-x-)))
(is (= "A B" (sut/sql-kw :a-b)))
(is (= "A B C" (sut/sql-kw :a-b-c)))
(is (= "A B C D" (sut/sql-kw :a-b-c-d)))
(is (= "FETCH NEXT" (sut/sql-kw :fetch-next))) (is (= "FETCH NEXT" (sut/sql-kw :fetch-next)))
(is (= "WHAT IS THIS" (sut/sql-kw :what-is-this))) (is (= "WHAT IS THIS" (sut/sql-kw :what-is-this)))
(is (= "FEE FIE FOE FUM" (sut/sql-kw :fee-fie-foe-fum))) (is (= "FEE FIE FOE FUM" (sut/sql-kw :fee-fie-foe-fum)))