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) } } }