refactor: add a test for short reads of floats in skipValue
This commit is contained in:
parent
d7c87d0562
commit
9767e2a21b
1 changed files with 5 additions and 0 deletions
|
|
@ -130,6 +130,11 @@ test "cbor.matchI64 error.IntegerTooLarge" {
|
||||||
try expectError(error.IntegerTooLarge, result);
|
try expectError(error.IntegerTooLarge, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "cbor.skipValue truncated float16 returns TooShort" {
|
||||||
|
const buf = [_]u8{ 0xf9, 0x3C };
|
||||||
|
try expectError(error.TooShort, match(&buf, any));
|
||||||
|
}
|
||||||
|
|
||||||
test "cbor.matchI64 error.IntegerTooSmall large negative" {
|
test "cbor.matchI64 error.IntegerTooSmall large negative" {
|
||||||
var buf = [_]u8{ 0x3B, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
var buf = [_]u8{ 0x3B, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||||
var iter: []const u8 = &buf;
|
var iter: []const u8 = &buf;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue