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.
32 lines
525 B
32 lines
525 B
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) |
|
} |
|
}) |
|
} |
|
}
|
|
|