2024-01-08 02:15:22 +01:00
|
|
|
;; Copyright (C) 2023 Felisp
|
|
|
|
;;
|
|
|
|
;; This program is free software: you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU Affero General Public License as published by
|
|
|
|
;; the Free Software Foundation, version 3 of the License.
|
|
|
|
;;
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU Affero General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU Affero General Public License
|
|
|
|
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
2024-01-05 14:31:44 +01:00
|
|
|
(ns rss-thread-watch.utils-test
|
|
|
|
(:require [clojure.test :refer :all]
|
|
|
|
[rss-thread-watch.utils :refer :all]))
|
|
|
|
|
2024-01-06 06:05:21 +01:00
|
|
|
(def first-map {:a :b
|
|
|
|
:c "c"})
|
|
|
|
(def empty-map {})
|
2024-01-05 14:31:44 +01:00
|
|
|
|
|
|
|
(deftest map-deep-merge-missing-test
|
2024-01-06 06:05:21 +01:00
|
|
|
(testing "Default values in place of missing keys"
|
|
|
|
(is (= first-map (map-apply-defaults first-map empty-map))
|
|
|
|
"No defaults should return conf map unchanged")
|
|
|
|
(is (= first-map (map-apply-defaults empty-map first-map))
|
|
|
|
"Empty map should be completely replaced by defaults")))
|