Additional unit tests.
This commit is contained in:
parent
a2ee0155ac
commit
e431f3ecb1
11 changed files with 269 additions and 12 deletions
|
|
@ -14,10 +14,6 @@ import (
|
|||
|
||||
// ToGoIdentifier converts database to Go identifier.
|
||||
func ToGoIdentifier(databaseIdentifier string) string {
|
||||
if len(databaseIdentifier) == 0 {
|
||||
return databaseIdentifier
|
||||
}
|
||||
|
||||
return snaker.SnakeToCamel(replaceInvalidChars(databaseIdentifier))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import (
|
|||
)
|
||||
|
||||
func TestToGoIdentifier(t *testing.T) {
|
||||
assert.Equal(t, ToGoIdentifier(""), "")
|
||||
assert.Equal(t, ToGoIdentifier("uuid"), "UUID")
|
||||
assert.Equal(t, ToGoIdentifier("col1"), "Col1")
|
||||
assert.Equal(t, ToGoIdentifier("PG-13"), "Pg13")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue