summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-10-07 17:18:06 +0800
committereltrac <hi@eltr.ac>2026-10-07 17:18:06 +0800
commitac5d88fae0f64609b522bd272587e9d98ca59a16 (patch)
treed2a25da56ae53708ba1c33b371ca3e9a98b0634b /src
parente6ca4cbecff78a0f26086178c48e8fc66914ab86 (diff)
test, verifier, utils: fix failed tests
- some namespaces tests require did not get renamed - url/extract might throw AssertionError if input contains non-HTTP(S) urls. it should not check schemes. - verifier doesn't need to filter non-HTTP(S) urls since they will return false anyway, and plus it makes localhost urls in tests fail
Diffstat (limited to 'src')
-rw-r--r--src/weepinbell/processor/verifier.clj3
-rw-r--r--src/weepinbell/utils/url.clj2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/weepinbell/processor/verifier.clj b/src/weepinbell/processor/verifier.clj
index 90f0786..37b91be 100644
--- a/src/weepinbell/processor/verifier.clj
+++ b/src/weepinbell/processor/verifier.clj
@@ -21,8 +21,7 @@
(defn- includes-url?
"Return true if text includes a certain URL. URLs are normalized before comparison."
[text url]
- (some #(url/url= % url)
- (filter url/valid-http-url? (url/extract text))))
+ (some #(url/url= % url) (url/extract text)))
(defn- verify-mention
"Get source and follow redirects to check if target link is present."
diff --git a/src/weepinbell/utils/url.clj b/src/weepinbell/utils/url.clj
index b8d53e8..03e7da8 100644
--- a/src/weepinbell/utils/url.clj
+++ b/src/weepinbell/utils/url.clj
@@ -60,7 +60,7 @@
"Given plain text. Returns a vector of URLs that appears in it."
[^String text]
{:pre [(string? text)]
- :post [#(every? valid-http-url? %)]}
+ :post [(partial every? string?)]}
(let [extractor (-> (LinkExtractor/builder)
(.linkTypes (EnumSet/of LinkType/URL))
.build)