(t *testing.T)
| 227 | } |
| 228 | |
| 229 | func TestEncodePackedInt64(t *testing.T) { |
| 230 | dest := make([]byte, 15) |
| 231 | enc := csproto.NewEncoder(dest) |
| 232 | enc.EncodePackedInt64(1, []int64{0, math.MaxInt64, 421138}) |
| 233 | |
| 234 | expected := []byte{ |
| 235 | // tag=1, wire type=2 |
| 236 | 0x0a, |
| 237 | // total length (13) |
| 238 | 0x0D, |
| 239 | // 0, |
| 240 | 0x00, |
| 241 | // math.MaxInt64 |
| 242 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, |
| 243 | // 421138 |
| 244 | 0x92, 0xDA, 0x19, |
| 245 | } |
| 246 | assert.Equal(t, expected, dest) |
| 247 | } |
| 248 | |
| 249 | func TestEncodeUInt32(t *testing.T) { |
| 250 | cases := []struct { |
nothing calls this directly
no test coverage detected