From cd91ba8bceba5a9451ca796c8684aa735ea4b0a7 Mon Sep 17 00:00:00 2001 From: Felisp Date: Sat, 12 Oct 2024 10:10:31 +0200 Subject: [PATCH] Add tests for filters --- test/rss_thread_watch/filter_test.clj | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/rss_thread_watch/filter_test.clj diff --git a/test/rss_thread_watch/filter_test.clj b/test/rss_thread_watch/filter_test.clj new file mode 100644 index 0000000..3924c35 --- /dev/null +++ b/test/rss_thread_watch/filter_test.clj @@ -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"])))) +