testing project

This commit is contained in:
2021-12-30 20:35:15 +01:00
parent d7f0e206ca
commit bafba8a7b6
7 changed files with 90 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
package importpackage
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)
}
}
}