Files
wehub-resource-sync ead81af521
Deploy to GitHub Pages / deploy (push) Failing after 0s
CI / go (push) Has been cancelled
CI / build (darwin, macos-14) (push) Has been cancelled
CI / build (windows, windows-2025) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:31:13 +08:00

25 lines
574 B
Go

package qobuz
import "testing"
func TestRegisterAndIsStreamURL(t *testing.T) {
const u = "https://streaming-qobuz.example/file/abc123?sig=xyz"
if IsStreamURL(u) {
t.Fatalf("url should not be registered yet")
}
registerStreamURL(u)
if !IsStreamURL(u) {
t.Fatalf("url should be registered after registerStreamURL")
}
if IsStreamURL("https://other.example/track") {
t.Fatalf("unrelated url should not match")
}
}
func TestRegisterStreamURLEmpty(t *testing.T) {
registerStreamURL("")
if IsStreamURL("") {
t.Fatalf("empty url must never be registered")
}
}