MCPcopy
hub / github.com/gin-gonic/gin / genLongPaths

Function genLongPaths

path_test.go:104–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102}
103
104func genLongPaths() (testPaths []cleanPathTest) {
105 for i := 1; i <= 1234; i++ {
106 ss := strings.Repeat("a", i)
107
108 correctPath := "/" + ss
109 testPaths = append(testPaths, cleanPathTest{
110 path: correctPath,
111 result: correctPath,
112 }, cleanPathTest{
113 path: ss,
114 result: correctPath,
115 }, cleanPathTest{
116 path: "//" + ss,
117 result: correctPath,
118 }, cleanPathTest{
119 path: "/" + ss + "/b/..",
120 result: correctPath,
121 })
122 }
123 return
124}
125
126func TestPathCleanLong(t *testing.T) {
127 cleanTests := genLongPaths()

Callers 2

TestPathCleanLongFunction · 0.85
BenchmarkPathCleanLongFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected