(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func 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 | } |
nothing calls this directly
no test coverage detected