Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
31
Task/Test-a-function/Go/test-a-function.go
Normal file
31
Task/Test-a-function/Go/test-a-function.go
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package pal
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestPals(t *testing.T) {
|
||||
pals := []string{
|
||||
"",
|
||||
".",
|
||||
"11",
|
||||
"ere",
|
||||
"ingirumimusnocteetconsumimurigni",
|
||||
}
|
||||
for _, s := range pals {
|
||||
if !IsPal(s) {
|
||||
t.Error("IsPal returned false on palindrome,", s)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestNonPals(t *testing.T) {
|
||||
nps := []string{
|
||||
"no",
|
||||
"odd",
|
||||
"salàlas",
|
||||
}
|
||||
for _, s := range nps {
|
||||
if IsPal(s) {
|
||||
t.Error("IsPal returned true on non-palindrome,", s)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue