(t *testing.T)
| 473 | } |
| 474 | |
| 475 | func TestEncodePackedSInt64(t *testing.T) { |
| 476 | dest := make([]byte, 19) |
| 477 | enc := csproto.NewEncoder(dest) |
| 478 | enc.EncodePackedSInt64(1, []int64{0, math.MaxInt64, 421138, -421138}) |
| 479 | |
| 480 | expected := []byte{ |
| 481 | // tag=1, wire type=2 |
| 482 | 0x0a, |
| 483 | // total length (17) |
| 484 | 0x11, |
| 485 | // 0, |
| 486 | 0x00, |
| 487 | // math.MaxInt64 |
| 488 | 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, |
| 489 | // 421138 |
| 490 | 0xA4, 0xB4, 0x33, |
| 491 | // -421138 |
| 492 | 0xA3, 0xB4, 0x33, |
| 493 | } |
| 494 | assert.Equal(t, expected, dest) |
| 495 | } |
| 496 | |
| 497 | func TestEncodeFixed32(t *testing.T) { |
| 498 | cases := []struct { |
nothing calls this directly
no test coverage detected