(t *testing.T)
| 337 | } |
| 338 | |
| 339 | func TestEncodePackedUInt64(t *testing.T) { |
| 340 | dest := make([]byte, 16) |
| 341 | enc := csproto.NewEncoder(dest) |
| 342 | enc.EncodePackedUInt64(1, []uint64{0, math.MaxUint64, 421138}) |
| 343 | |
| 344 | expected := []byte{ |
| 345 | // tag=1, wire type=2 |
| 346 | 0x0a, |
| 347 | // total length (14) |
| 348 | 0x0E, |
| 349 | // 0, |
| 350 | 0x00, |
| 351 | // math.MaxUint64 |
| 352 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1, |
| 353 | // 421138 |
| 354 | 0x92, 0xDA, 0x19, |
| 355 | } |
| 356 | assert.Equal(t, expected, dest) |
| 357 | } |
| 358 | |
| 359 | func TestEncodeSInt32(t *testing.T) { |
| 360 | cases := []struct { |
nothing calls this directly
no test coverage detected