Bake the former Python bridge.py into emby-mcp as internal/bridge.
/mcp and /call/{tool} share one process. Session init errors are
returned instead of swallowed, and 401/400/404 trigger a fresh
initialize plus retry with the caller's Authorization header.
26 lines
520 B
Go
26 lines
520 B
Go
package textutil
|
|
|
|
import "testing"
|
|
|
|
func TestFold(t *testing.T) {
|
|
cases := map[string]string{
|
|
"Café MÜLLER": "cafe muller",
|
|
"Hello": "hello",
|
|
"naïve": "naive",
|
|
}
|
|
for in, want := range cases {
|
|
if got := Fold(in); got != want {
|
|
t.Errorf("Fold(%q) = %q, want %q", in, got, want)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestContainsFold(t *testing.T) {
|
|
if !ContainsFold("The über cast of café", "uber") {
|
|
t.Error("expected fold match")
|
|
}
|
|
if ContainsFold("hello world", "bye") {
|
|
t.Error("unexpected match")
|
|
}
|
|
}
|