- Replace log.Faltal with error wrapping in schemagen func - Simplify tests, use temp dir and ioutil functions, remove boilerplate code - In test use schemagen keyspace to avoid name conflict with examples - Change template
32 lines
705 B
Go
32 lines
705 B
Go
// Copyright (C) 2017 ScyllaDB
|
|
// Use of this source code is governed by a ALv2-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package main
|
|
|
|
import "testing"
|
|
|
|
func TestCamelize(t *testing.T) {
|
|
tests := []struct {
|
|
input string
|
|
want string
|
|
}{
|
|
{"hello", "Hello"},
|
|
{"_hello", "Hello"},
|
|
{"__hello", "Hello"},
|
|
{"hello_", "Hello"},
|
|
{"hello_world", "HelloWorld"},
|
|
{"hello__world", "HelloWorld"},
|
|
{"_hello_world", "HelloWorld"},
|
|
{"helloWorld", "HelloWorld"},
|
|
{"HelloWorld", "HelloWorld"},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.input, func(t *testing.T) {
|
|
if got := camelize(tt.input); got != tt.want {
|
|
t.Errorf("camelize() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|