[bug] Escape reserved words used as identifier.

This commit is contained in:
go-jet 2020-02-16 10:25:21 +01:00
parent 63c1fd6430
commit 3019fdbbb2
10 changed files with 226 additions and 4 deletions

View file

@ -291,7 +291,7 @@ func TestGeneratedAllTypesSQLBuilderFiles(t *testing.T) {
assert.NoError(t, err)
testutils.AssertFileNamesEqual(t, modelFiles, "all_types.go", "all_types_view.go", "employee.go", "link.go",
"mood.go", "person.go", "person_phone.go", "weird_names_table.go", "level.go")
"mood.go", "person.go", "person_phone.go", "weird_names_table.go", "level.go", "user.go")
testutils.AssertFileContent(t, modelDir+"all_types.go", "\npackage model", allTypesModelContent)
@ -299,7 +299,7 @@ func TestGeneratedAllTypesSQLBuilderFiles(t *testing.T) {
assert.NoError(t, err)
testutils.AssertFileNamesEqual(t, tableFiles, "all_types.go", "employee.go", "link.go",
"person.go", "person_phone.go", "weird_names_table.go")
"person.go", "person_phone.go", "weird_names_table.go", "user.go")
testutils.AssertFileContent(t, tableDir+"all_types.go", "\npackage table", allTypesTableContent)
}