/
githubmirror
/
gogs
Обзор
Документация
Войти
/
githubmirror
/
gogs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
internal/database/wiki_test.go
27 строк
571 B
ᴊᴏᴇ ᴄʜᴇɴ
wiki: sanitize old wiki page name when editing (#8099)
22 янв 2026, 19:00
Не верифицирован
22 янв 2026, 19:00
1bbc361
Код
Авторство
О чём код?
package database import ( "testing" "github.com/stretchr/testify/require" ) func TestToWikiPageName(t *testing.T) { tests := []struct { input string want string }{ {input: "Home", want: "Home"}, {input: "../../../../tmp/target_file", want: "tmp target_file"}, {input: "..\\..\\..\\..\\tmp\\target_file", want: "tmp target_file"}, {input: "A/B", want: "A B"}, {input: "../pwn", want: "pwn"}, } for _, test := range tests { t.Run(test.input, func(t *testing.T) { got := ToWikiPageName(test.input) require.Equal(t, test.want, got) }) } }