(t *testing.T)
| 128 | } |
| 129 | |
| 130 | func TestGoNativeTypeName(t *testing.T) { |
| 131 | cases := map[string]struct { |
| 132 | dataType expr.DataType |
| 133 | expected string |
| 134 | }{ |
| 135 | "BooleanKind": {expr.Boolean, "bool"}, |
| 136 | "IntKind": {expr.Int, "int"}, |
| 137 | "Int32Kind": {expr.Int32, "int32"}, |
| 138 | "Int64Kind": {expr.Int64, "int64"}, |
| 139 | "UIntKind": {expr.UInt, "uint"}, |
| 140 | "UInt32Kind": {expr.UInt32, "uint32"}, |
| 141 | "UInt64Kind": {expr.UInt64, "uint64"}, |
| 142 | "Float32Kind": {expr.Float32, "float32"}, |
| 143 | "Float64Kind": {expr.Float64, "float64"}, |
| 144 | "StringKind": {expr.String, "string"}, |
| 145 | "BytesKind": {expr.Bytes, "[]byte"}, |
| 146 | "AnyKind": {expr.Any, "any"}, |
| 147 | } |
| 148 | |
| 149 | for k, tc := range cases { |
| 150 | actual := GoNativeTypeName(tc.dataType) |
| 151 | if actual != tc.expected { |
| 152 | t.Errorf("%s: got %#v, expected %#v", k, actual, tc.expected) |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | func TestAttributeTagsWithName_JSONName(t *testing.T) { |
| 158 | parent := &expr.AttributeExpr{ |
nothing calls this directly
no test coverage detected