This commit is contained in:
Siegfried Siegert 2020-06-22 21:47:53 +02:00
parent 5f9f0b3371
commit f339311520

19
reverse_test.go Normal file
View File

@ -0,0 +1,19 @@
package morestrings
import "testing"
func TestReverseRunes(t *testing.T) {
cases := []struct {
in, want string
}{
{"Hello, world", "dlrow ,olleH"},
{"Hello, 世界", "界世 ,olleH"},
{"", ""},
}
for _, c := range cases {
got := ReverseRunes(c.in)
if got != c.want {
t.Errorf("ReverseRunes(%q) == %q, want %q", c.in, got, c.want)
}
}
}