MCPcopy Create free account
hub / github.com/exercism/cli / TestInferSiteURL

Function TestInferSiteURL

config/config_test.go:9–24  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func 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}

Callers

nothing calls this directly

Calls 1

InferSiteURLFunction · 0.85

Tested by

no test coverage detected