(t *testing.T)
| 183 | } |
| 184 | |
| 185 | func TestInlineMarshaler(t *testing.T) { |
| 186 | enc := NewMapObjectEncoder() |
| 187 | |
| 188 | topLevelStr := Field{Key: "k", Type: StringType, String: "s"} |
| 189 | topLevelStr.AddTo(enc) |
| 190 | |
| 191 | inlineObj := Field{Key: "ignored", Type: InlineMarshalerType, Interface: users(10)} |
| 192 | inlineObj.AddTo(enc) |
| 193 | |
| 194 | nestedObj := Field{Key: "nested", Type: ObjectMarshalerType, Interface: users(11)} |
| 195 | nestedObj.AddTo(enc) |
| 196 | |
| 197 | assert.Equal(t, map[string]interface{}{ |
| 198 | "k": "s", |
| 199 | "users": 10, |
| 200 | "nested": map[string]interface{}{ |
| 201 | "users": 11, |
| 202 | }, |
| 203 | }, enc.Fields) |
| 204 | } |
| 205 | |
| 206 | func TestEquals(t *testing.T) { |
| 207 | // Values outside the UnixNano range were encoded incorrectly (#737, #803). |
nothing calls this directly
no test coverage detected