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

Update template_functions_test.go

Cette révision appartient à :
kilo 2017-11-01 09:40:41 +01:00 révisé par GitHub
Parent 540a9cd296
révision abaec4015f
Signature inconnue de Forgejo
ID de la clé GPG: 4AEE18F83AFDEB23
1 fichiers modifiés avec 16 ajouts et 17 suppressions

Voir le fichier

@ -669,42 +669,41 @@ func Teststrcmp(t *testing.T) {
var tests = []struct {
TestString string
TestString2 string
TestStart int
Match bool
}{
{
TestString: "kilo",
TestString2: "kilo",
TestStart: 0,
Match: true,
},
{
TestString: "kilo",
TestString2: "loki",
TestStart: 0,
Match: false,
},
{
TestString: "akumeme",
TestString2: "meme",
TestStart: 0,
Match: true,
},
{
TestString: "memeaku",
TestString2: "meme",
TestStart: 4, //Search "meme" in "aku", obviously not there
Match: false,
},
}
for _, test := range tests {
value := strfind(test.TestString, test.TestString2, 0)
value := strfind(test.TestString, test.TestString2, test.TestStart)
if value != test.Match {
t.Errorf("Unexpected value from the function strfind, got '%t', wanted '%t'", value, test.Match, test.TestString, test.TestString)
}
}
}
func TestRand(t *testing.T) {
var tests = []struct {
TestMax int
}{
{
TestMax: 0,
},
}
for _, test := range tests {
value := rand(test.TestMax)
if value > test.TestMax {
t.Errorf("Unexpected value from the function rand, got '%t', max of '%t'", value, test.TestMax)
}
}
}
func TestGetDomain(t *testing.T) {
var tests = []struct {