yak(behavior-tests-blogex-public-api-and-router-plumbing-q1fb): behavior tests: blogex public API and router plumbing

This commit is contained in:
Willem van den Ende
2026-10-28 22:15:02 +00:00
parent c04d8c856c
commit cc03cefe8d
9 changed files with 211 additions and 46 deletions
+4 -4
View File
@@ -232,10 +232,10 @@ defmodule Blogex.LinkValidator do
@doc false
@spec slug_end(String.t()) :: integer()
defp slug_end(str) do
case String.split(str, ["?", "#"], parts: 2) do
[slug | _] -> String.length(slug)
_ -> String.length(str)
end
# `String.split/3` always returns a non-empty list whose head is a binary,
# so there is no empty/other case to handle here.
[slug | _] = String.split(str, ["?", "#"], parts: 2)
String.length(slug)
end
@doc false