(t *testing.T)
| 24 | ) |
| 25 | |
| 26 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…