bilibili-backup/app/tool/protoc-gen-bm/util/style_test.go

33 lines
525 B
Go
Raw Normal View History

2019-04-22 10:59:20 +08:00
package util
import "testing"
func TestCamelCase(t *testing.T) {
type args struct {
name string
}
tests := []struct {
name string
args args
want string
}{
{
name: "test1",
args: args{name: "_test"},
want: "_test",
},
{
name: "test2",
args: args{name: "hello_world"},
want: "HelloWorld",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := CamelCase(tt.args.name); got != tt.want {
t.Errorf("CamelCase() = %v, want %v", got, tt.want)
}
})
}
}