MCPcopy Create free account
hub / github.com/Shelnutt2/db2struct / TestLintFieldName

Function TestLintFieldName

utils_test.go:9–39  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestLintFieldName(t *testing.T) {
10 name := lintFieldName("_")
11 Convey("Should get underscore as fieldName", t, func() {
12 So(name, ShouldEqual, "_")
13 })
14
15 name = lintFieldName("foo_id")
16 Convey("Should be able to convert field name", t, func() {
17 So(name, ShouldEqual, "FooID")
18 })
19
20 name = lintFieldName("foo__id")
21 Convey("Should be able to convert field name", t, func() {
22 So(name, ShouldEqual, "FooID")
23 })
24
25 name = lintFieldName("1__2")
26 Convey("Should be able to convert field name", t, func() {
27 So(name, ShouldEqual, "1_2")
28 })
29
30 name = lintFieldName("_id")
31 Convey("Should be able to convert field name", t, func() {
32 So(name, ShouldEqual, "ID")
33 })
34
35 name = lintFieldName("foo")
36 Convey("Should be able to convert field name", t, func() {
37 So(name, ShouldEqual, "Foo")
38 })
39}
40
41func TestMysqlStringGenerate(t *testing.T) {
42 expectedStruct :=

Callers

nothing calls this directly

Calls 1

lintFieldNameFunction · 0.85

Tested by

no test coverage detected