Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0

add GetCategoryName() to template_test

Cette révision appartient à :
kilo 2017-11-10 13:05:15 +01:00 révisé par GitHub
Parent b4fe1b571d
révision 5a35620c37
Signature inconnue de Forgejo
ID de la clé GPG: 4AEE18F83AFDEB23
1 fichiers modifiés avec 31 ajouts et 0 suppressions

Voir le fichier

@ -289,6 +289,37 @@ func TestCategoryName(t *testing.T) {
}
}
func TestCategoryName2(t *testing.T) {
var tests = []struct {
TestCat string
Expected string
}{
{
TestCat: "_",
Expected: "",
},
{
TestCat: "d",
Expected: "",
},
{
TestCat: "3_",
Expected: "anime",
},
{
TestCat: "3_6",
Expected: "anime_raw",
},
}
for _, test := range tests {
value := GetCategoryName(test.TestCat)
if value != test.Expected {
t.Errorf("Unexpected value from the function categoryName, got '%s', wanted '%s' for '%s'", value, test.Expected, test.TestCat)
}
}
}
func TestLanguageName(t *testing.T) {
var tests = []struct {
TestLang publicSettings.Language