(t *testing.T)
| 404 | } |
| 405 | |
| 406 | func TestEncodePackedSInt32(t *testing.T) { |
| 407 | dest := make([]byte, 10) |
| 408 | enc := csproto.NewEncoder(dest) |
| 409 | enc.EncodePackedSInt32(1, []int32{0, math.MaxInt32, 42, -42}) |
| 410 | |
| 411 | expected := []byte{ |
| 412 | // tag=1, wire type=2 |
| 413 | 0x0a, |
| 414 | // total length (8) |
| 415 | 0x08, |
| 416 | // 0, |
| 417 | 0x00, |
| 418 | // math.MaxUint32 |
| 419 | 0xFE, 0xFF, 0xFF, 0xFF, 0x0F, |
| 420 | // 42 |
| 421 | 0x54, |
| 422 | // -42 |
| 423 | 0x53, |
| 424 | } |
| 425 | assert.Equal(t, expected, dest) |
| 426 | } |
| 427 | |
| 428 | func TestEncodeSInt64(t *testing.T) { |
| 429 | cases := []struct { |
nothing calls this directly
no test coverage detected