style_test.go 525 B

1234567891011121314151617181920212223242526272829303132
  1. package util
  2. import "testing"
  3. func TestCamelCase(t *testing.T) {
  4. type args struct {
  5. name string
  6. }
  7. tests := []struct {
  8. name string
  9. args args
  10. want string
  11. }{
  12. {
  13. name: "test1",
  14. args: args{name: "_test"},
  15. want: "_test",
  16. },
  17. {
  18. name: "test2",
  19. args: args{name: "hello_world"},
  20. want: "HelloWorld",
  21. },
  22. }
  23. for _, tt := range tests {
  24. t.Run(tt.name, func(t *testing.T) {
  25. if got := CamelCase(tt.args.name); got != tt.want {
  26. t.Errorf("CamelCase() = %v, want %v", got, tt.want)
  27. }
  28. })
  29. }
  30. }