(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestInferSiteURL(t *testing.T) { |
| 10 | testCases := []struct { |
| 11 | api, url string |
| 12 | }{ |
| 13 | {"https://api.exercism.org/v1", "https://exercism.org"}, |
| 14 | {"https://v2.exercism.org/api/v1", "https://v2.exercism.org"}, |
| 15 | {"https://mentors-beta.exercism.org/api/v1", "https://mentors-beta.exercism.org"}, |
| 16 | {"http://localhost:3000/api/v1", "http://localhost:3000"}, |
| 17 | {"", "https://exercism.org"}, // use the default |
| 18 | {"http://whatever", "http://whatever"}, // you're on your own, pal |
| 19 | } |
| 20 | |
| 21 | for _, tc := range testCases { |
| 22 | assert.Equal(t, InferSiteURL(tc.api), tc.url) |
| 23 | } |
| 24 | } |
nothing calls this directly
no test coverage detected