(t *testing.T)
| 290 | } |
| 291 | |
| 292 | func TestEncoder(t *testing.T) { |
| 293 | var buf bytes.Buffer |
| 294 | enc := msgpack.NewEncoder(&buf) |
| 295 | enc.SetCustomStructTag("json") |
| 296 | enc.SetSortMapKeys(true) |
| 297 | enc.UseCompactInts(true) |
| 298 | |
| 299 | for i, test := range encoderTests { |
| 300 | buf.Reset() |
| 301 | |
| 302 | err := enc.Encode(test.in) |
| 303 | require.Nil(t, err) |
| 304 | |
| 305 | s := hex.EncodeToString(buf.Bytes()) |
| 306 | require.Equal(t, test.wanted, s, "#%d", i) |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | type floatEncoderTest struct { |
| 311 | in interface{} |
nothing calls this directly
no test coverage detected
searching dependent graphs…