indexer/scraper/scraper_test.go
Ricardo (XenGi) Band 63c6f4b761
Some checks failed
CI pipeline for ffd-indexer / checks (go test + golangci) (push) Failing after 26s
CI pipeline for ffd-indexer / build binaries + containers (push) Failing after 3s
CI pipeline for ffd-indexer / format (gofmt + nixfmt) (push) Failing after 3s
CI pipeline for ffd-indexer / integration (live scrape + Typesense) (push) Failing after 20s
🔥
2026-10-01 00:37:44 +02:00

24 lines
639 B
Go

package scraper
import "testing"
func TestScheme(t *testing.T) {
tests := []struct {
in string
scheme string
fqdn string
}{
{"git.example.org", "https", "git.example.org"},
{"https://git.example.org", "https", "git.example.org"},
{"http://git.example.org", "http", "git.example.org"},
{"https://git.example.org/", "https", "git.example.org"},
{"http://git.example.net", "http", "git.example.net"},
}
for _, tt := range tests {
scheme, fqdn := Scheme(tt.in)
if scheme != tt.scheme || fqdn != tt.fqdn {
t.Errorf("Scheme(%q) = (%q, %q), want (%q, %q)",
tt.in, scheme, fqdn, tt.scheme, tt.fqdn)
}
}
}