MCPcopy Create free account
hub / github.com/compose-spec/compose-go / TestConvertWindowsVolumePath

Function TestConvertWindowsVolumePath

loader/loader_windows_test.go:26–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24)
25
26func TestConvertWindowsVolumePath(t *testing.T) {
27 testcases := []struct {
28 windowsPath string
29 expectedConvertedPath string
30 }{
31 {
32 windowsPath: "c:\\hello\\docker",
33 expectedConvertedPath: "/c/hello/docker",
34 },
35 {
36 windowsPath: "d:\\compose",
37 expectedConvertedPath: "/d/compose",
38 },
39 {
40 windowsPath: "e:\\path with spaces\\compose",
41 expectedConvertedPath: "/e/path with spaces/compose",
42 },
43 }
44 for _, testcase := range testcases {
45 volume := types.ServiceVolumeConfig{
46 Type: "bind",
47 Source: testcase.windowsPath,
48 Target: "/test",
49 }
50
51 assert.Equal(t, testcase.expectedConvertedPath, convertVolumePath(volume).Source)
52 }
53}

Callers

nothing calls this directly

Calls 1

convertVolumePathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…