支付模块
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

reverse_test.go 327 B

2 years ago
123456789101112131415161718
  1. package stringutil
  2. import "testing"
  3. func TestReverse(t *testing.T) {
  4. for _, c := range []struct {
  5. in, want string
  6. }{
  7. {"Hello, world", "dlrow ,olleH"},
  8. {"Hello, 世界", "界世 ,olleH"},
  9. {"", ""},
  10. } {
  11. got := Reverse(c.in)
  12. if got != c.want {
  13. t.Errorf("Reverse(%q) == %q, want %q", c.in, got, c.want)
  14. }
  15. }
  16. }