(t *testing.T)
| 160 | } |
| 161 | |
| 162 | func TestEncodePackedInt32(t *testing.T) { |
| 163 | dest := make([]byte, 9) |
| 164 | enc := csproto.NewEncoder(dest) |
| 165 | enc.EncodePackedInt32(1, []int32{0, math.MaxInt32, 42}) |
| 166 | |
| 167 | expected := []byte{ |
| 168 | // tag=1, wire type=2 |
| 169 | 0x0a, |
| 170 | // total length (7) |
| 171 | 0x07, |
| 172 | // 0, |
| 173 | 0x00, |
| 174 | // math.MaxInt32 |
| 175 | 0xFF, 0xFF, 0xFF, 0xFF, 0x07, |
| 176 | // 42 |
| 177 | 0x2A, |
| 178 | } |
| 179 | assert.Equal(t, expected, dest) |
| 180 | } |
| 181 | |
| 182 | func TestEncodeInt64(t *testing.T) { |
| 183 | cases := []struct { |
nothing calls this directly
no test coverage detected