支付模块
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.

18 lines
327 B

  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. }