MCPcopy Create free account
hub / github.com/ddev/ddev / TestPathWithSlashesToArray

Function TestPathWithSlashesToArray

pkg/nodeps/utils_test.go:22–39  ·  view source on GitHub ↗

TestPathWithSlashesToArray tests PathWithSlashesToArray

(t *testing.T)

Source from the content-addressed store, hash-verified

20
21// TestPathWithSlashesToArray tests PathWithSlashesToArray
22func TestPathWithSlashesToArray(t *testing.T) {
23 testSources := []string{
24 "sites/default/files",
25 "/sites/default/files",
26 "./sites/default/files",
27 }
28
29 testExpectations := [][]string{
30 {"sites", "sites/default", "sites/default/files"},
31 {"/sites", "/sites/default", "/sites/default/files"},
32 {".", "./sites", "./sites/default", "./sites/default/files"},
33 }
34
35 for i := range testSources {
36 res := nodeps.PathWithSlashesToArray(testSources[i])
37 require.Equal(t, testExpectations[i], res)
38 }
39}
40
41// TestParseURL tests the ParseURL function
42func TestParseURL(t *testing.T) {

Callers

nothing calls this directly

Calls 1

PathWithSlashesToArrayFunction · 0.92

Tested by

no test coverage detected