MCPcopy Index your code
hub / github.com/oapi-codegen/oapi-codegen / TestSplitString

Function TestSplitString

pkg/util/inputmapping_test.go:40–62  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

38}
39
40func TestSplitString(t *testing.T) {
41 var src string
42 var expected, result []string
43 var err error
44
45 src = "1,2,3"
46 expected = []string{"1", "2", "3"}
47 result = splitString(src, ',')
48 require.NoError(t, err)
49 assert.Equal(t, expected, result)
50
51 src = `"1,2",3`
52 expected = []string{`"1,2"`, "3"}
53 result = splitString(src, ',')
54 require.NoError(t, err)
55 assert.Equal(t, expected, result)
56
57 src = `1,"2,3",`
58 expected = []string{"1", `"2,3"`, ""}
59 result = splitString(src, ',')
60 require.NoError(t, err)
61 assert.Equal(t, expected, result)
62}

Callers

nothing calls this directly

Calls 1

splitStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…