MCPcopy Create free account
hub / github.com/gogs/gogs / TestToWikiPageName

Function TestToWikiPageName

internal/database/wiki_test.go:9–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestToWikiPageName(t *testing.T) {
10 tests := []struct {
11 input string
12 want string
13 }{
14 {input: "Home", want: "Home"},
15 {input: "../../../../tmp/target_file", want: "tmp target_file"},
16 {input: "..\\..\\..\\..\\tmp\\target_file", want: "tmp target_file"},
17 {input: "A/B", want: "A B"},
18 {input: "../pwn", want: "pwn"},
19 }
20
21 for _, test := range tests {
22 t.Run(test.input, func(t *testing.T) {
23 got := ToWikiPageName(test.input)
24 require.Equal(t, test.want, got)
25 })
26 }
27}

Callers

nothing calls this directly

Calls 1

ToWikiPageNameFunction · 0.85

Tested by

no test coverage detected