2025-02-21 00:47:27 +00:00
|
|
|
;; copyright (c) 2023-2025 sean corfield, all rights reserved
|
2023-01-14 23:35:03 +00:00
|
|
|
|
|
|
|
|
(ns honey.ops-test
|
|
|
|
|
(:refer-clojure :exclude [format])
|
|
|
|
|
(:require [clojure.test :refer [deftest is]]
|
2024-02-10 06:39:38 +00:00
|
|
|
[honey.sql :as sut]))
|
2023-01-14 23:35:03 +00:00
|
|
|
|
|
|
|
|
(deftest issue-454
|
|
|
|
|
(is (= ["SELECT a - b - c AS x"]
|
|
|
|
|
(-> {:select [[[:- :a :b :c] :x]]}
|
2024-02-10 06:39:38 +00:00
|
|
|
(sut/format)))))
|
2025-02-21 00:47:27 +00:00
|
|
|
|
|
|
|
|
(deftest issue-566
|
|
|
|
|
(is (= ["SELECT * FROM table WHERE a IS DISTINCT FROM b"]
|
|
|
|
|
(-> {:select :* :from :table :where [:is-distinct-from :a :b]}
|
|
|
|
|
(sut/format))))
|
|
|
|
|
(is (= ["SELECT * FROM table WHERE a IS NOT DISTINCT FROM b"]
|
|
|
|
|
(-> {:select :* :from :table :where [:is-not-distinct-from :a :b]}
|
|
|
|
|
(sut/format)))))
|