(t *testing.T)
| 282 | } |
| 283 | |
| 284 | func TestEncodePackedUInt32(t *testing.T) { |
| 285 | dest := make([]byte, 9) |
| 286 | enc := csproto.NewEncoder(dest) |
| 287 | enc.EncodePackedUInt32(1, []uint32{0, math.MaxUint32, 42}) |
| 288 | |
| 289 | expected := []byte{ |
| 290 | // tag=1, wire type=2 |
| 291 | 0x0a, |
| 292 | // total length (7) |
| 293 | 0x07, |
| 294 | // 0, |
| 295 | 0x00, |
| 296 | // math.MaxUint32 |
| 297 | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, |
| 298 | // 42 |
| 299 | 0x2A, |
| 300 | } |
| 301 | assert.Equal(t, expected, dest) |
| 302 | } |
| 303 | |
| 304 | func TestEncodeUInt64(t *testing.T) { |
| 305 | cases := []struct { |
nothing calls this directly
no test coverage detected