diff options
| author | eltrac <hi@eltr.ac> | 2026-09-16 10:11:07 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-09-16 10:11:07 +0800 |
| commit | d54b08ee4139de3bf373b21be5e662970e18e586 (patch) | |
| tree | b779d5b963219b6702e4e553810f5f9192d6bff6 /test | |
| parent | f2a9bf15a35cea1d7c3d1a3b2ad1cb809a9daf85 (diff) | |
style: format the codebase
starting from now, every commit should be cljfmt-fixed
Diffstat (limited to 'test')
| -rw-r--r-- | test/weepinbell/handler_test.clj | 32 | ||||
| -rw-r--r-- | test/weepinbell/receiver_test.clj | 34 | ||||
| -rw-r--r-- | test/weepinbell/storage_test.clj | 4 |
3 files changed, 35 insertions, 35 deletions
diff --git a/test/weepinbell/handler_test.clj b/test/weepinbell/handler_test.clj index baa3832..b718e34 100644 --- a/test/weepinbell/handler_test.clj +++ b/test/weepinbell/handler_test.clj @@ -6,10 +6,10 @@ (defmacro test-mention-list-by-domain-route [mftype] `(testing (str "/api/" ~mftype "/:domain route") (let [~'response ((app nil {:get-by-domain (fn [~'_] - [{:webmention {:source "" - :target "" - :id "" - :modified 0}}])} + [{:webmention {:source "" + :target "" + :id "" + :modified 0}}])} {}) (mock/request :get (str "/api/" ~mftype "/www.example")))] (is (= (:status ~'response) 200))))) @@ -17,10 +17,10 @@ (defmacro test-mention-list-by-url-route [mftype] `(testing (str "/api/" ~mftype "?url= route") (let [~'response ((app nil {:get-by-domain (fn [~'_] - [{:webmention {:source "" - :target "http://localhost/" - :id "" - :modified 0}}])} + [{:webmention {:source "" + :target "http://localhost/" + :id "" + :modified 0}}])} {}) (mock/request :get (str "/api/" ~mftype "?url=http://localhost")))] (is (= (:status ~'response) 200))))) @@ -42,20 +42,20 @@ (testing "/api/mention/:id" (let [response ((app nil {:get (fn [_] - {:webmention {:source "" - :target "" - :id "xxx" - :modified 0}})} + {:webmention {:source "" + :target "" + :id "xxx" + :modified 0}})} {}) (mock/request :get "/api/mention/xxx"))] (is (= (:status response) 200)))) (testing "/api/mention/?source=&target=" (let [response ((app nil {:get (fn [_ _] - {:webmention {:source "1" - :target "2" - :id "xxx" - :modified 0}})} + {:webmention {:source "1" + :target "2" + :id "xxx" + :modified 0}})} {}) (mock/request :get "/api/mention/?source=1&?target=2"))] (is (= (:status response) 200))))) diff --git a/test/weepinbell/receiver_test.clj b/test/weepinbell/receiver_test.clj index 576a9e3..a0524dc 100644 --- a/test/weepinbell/receiver_test.clj +++ b/test/weepinbell/receiver_test.clj @@ -101,27 +101,27 @@ ;; anchor removing test (deftest anchor-remove-test (testing "Receiver should remove anchor in URL before pushing it into queue" - (let [cases [{:has ["https://bob.blog/page/1#heading-a" + (let [cases [{:has ["https://bob.blog/page/1#heading-a" "https://alice.blog/"] - :expects ["https://bob.blog/page/1" - "https://alice.blog/"]} - {:has ["https://bob.blog/page/1" + :expects ["https://bob.blog/page/1" + "https://alice.blog/"]} + {:has ["https://bob.blog/page/1" "https://alice.blog/archive/a#heading-1"] - :expects ["https://bob.blog/page/1" - "https://alice.blog/archive/a"]} - {:has ["https://bob.blog/page/1#heading-a" + :expects ["https://bob.blog/page/1" + "https://alice.blog/archive/a"]} + {:has ["https://bob.blog/page/1#heading-a" "https://alice.blog/archive/a#heading-1"] - :expects ["https://bob.blog/page/1" - "https://alice.blog/archive/a"]} - {:has ["https://bob.blog/page/1" + :expects ["https://bob.blog/page/1" + "https://alice.blog/archive/a"]} + {:has ["https://bob.blog/page/1" "https://alice.blog/archive/a"] - :expects ["https://bob.blog/page/1" - "https://alice.blog/archive/a"]} - {:has ["https://bob.blog/?page=1&key=value#heading-1" + :expects ["https://bob.blog/page/1" + "https://alice.blog/archive/a"]} + {:has ["https://bob.blog/?page=1&key=value#heading-1" "https://alice.blog/archive/a"] - :expects ["https://bob.blog/?page=1&key=value" - "https://alice.blog/archive/a"]}]] - (->> cases + :expects ["https://bob.blog/?page=1&key=value" + "https://alice.blog/archive/a"]}]] + (->> cases (map (fn [case] (let [hs (get-in case [:has 0]) ht (get-in case [:has 1]) @@ -133,4 +133,4 @@ (let [{:keys [s t]} (<!! test-queue)] (is (= s es)) (is (= t et)))))) - doall)))) + doall)))) diff --git a/test/weepinbell/storage_test.clj b/test/weepinbell/storage_test.clj index 0bbf07e..4182fd2 100644 --- a/test/weepinbell/storage_test.clj +++ b/test/weepinbell/storage_test.clj @@ -5,8 +5,8 @@ [weepinbell.utils]
[weepinbell.spec]))
-(deftest edn-storage-conformity-test
+(deftest edn-storage-conformity-test
(testing "edn-storage should conform storage spec."
(with-redefs [weepinbell.utils/file-exists? (fn [_] true)]
- (is (s/valid? :weepinbell.spec/storage
+ (is (s/valid? :weepinbell.spec/storage
(edns/use-store "source.edn"))))))
|
