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

Function TestResolve

config/resolve_notwin_test.go:13–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestResolve(t *testing.T) {
14 cwd, err := os.Getwd()
15 assert.NoError(t, err)
16
17 testCases := []struct {
18 in, out string
19 }{
20 {"", ""}, // don't make wild guesses
21 {"/home/alice///foobar", "/home/alice/foobar"},
22 {"~/foobar", "/home/alice/foobar"},
23 {"/foobar/~/noexpand", "/foobar/~/noexpand"},
24 {"/no/modification", "/no/modification"},
25 {"relative", filepath.Join(cwd, "relative")},
26 {"relative///path", filepath.Join(cwd, "relative", "path")},
27 }
28
29 for _, tc := range testCases {
30 testName := "'" + tc.in + "' should be normalized as '" + tc.out + "'"
31 t.Run(testName, func(t *testing.T) {
32 assert.Equal(t, tc.out, Resolve(tc.in, "/home/alice"), testName)
33 })
34 }
35}

Callers

nothing calls this directly

Calls 1

ResolveFunction · 0.85

Tested by

no test coverage detected