(t *testing.T)
| 157 | } |
| 158 | |
| 159 | func TestReadCollectionLengthDoesNotTreatElementsAsBytes(t *testing.T) { |
| 160 | writer := NewByteBuffer(nil) |
| 161 | writer.WriteLength(1024) |
| 162 | |
| 163 | ctx := NewReadContext(false) |
| 164 | ctx.SetData(writer.Bytes()) |
| 165 | |
| 166 | require.Equal(t, 1024, ctx.ReadCollectionLength()) |
| 167 | require.False(t, ctx.HasError()) |
| 168 | } |
| 169 | |
| 170 | func TestReadVarUint32Small7RejectsOverflowFifthByte(t *testing.T) { |
| 171 | buf := NewByteBuffer([]byte{0x80, 0x80, 0x80, 0x80, 0x10}) |
nothing calls this directly
no test coverage detected