(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func 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 | |
| 41 | func TestMysqlStringGenerate(t *testing.T) { |
| 42 | expectedStruct := |
nothing calls this directly
no test coverage detected