Добавить stringutil/stringutil_test.go

This commit is contained in:
2026-05-17 22:22:49 +03:00
parent 95b43d9102
commit 7345f498ca

View File

@@ -0,0 +1,20 @@
package stringutil
import "testing"
func TestReverse(t *testing.T) {
result := Reverse("hello")
expected := "olleh"
if result != expected {
t.Errorf("Reverse('hello') = %s; want %s", result, expected)
}
}
func TestIsPalindrome(t *testing.T) {
if !IsPalindrome("aba") {
t.Error("IsPalindrome('aba') = false; want true")
}
if IsPalindrome("ab") {
t.Error("IsPalindrome('ab') = true; want false")
}
}