Add tests for filters

This commit is contained in:
Felisp 2024-10-12 10:10:31 +02:00
parent 7c1720cd4e
commit cd91ba8bce

View file

@ -0,0 +1,17 @@
(ns rss-thread-watch.filter-test
(:require [clojure.test :refer :all]
[rss-thread-watch.filters :refer :all]))
(def thread {:title "This is a thread TiTle wItH some extRa text"
:no 928398237932
:chod 92})
(deftest filters
(testing "Case sensitive filter"
(is (case-sensitive-filter thread ["TiTle"]))
(is (= (case-sensitive-filter thread ["TITLE"]) nil)))
(testing "Case insensitive filter"
(is (case-insensitive-filter thread ["TiTle"]))
(is (case-insensitive-filter thread ["with"]))))