refactor: add a testcase for large negative integer panic
This commit is contained in:
parent
b13b4cd1af
commit
13f8a698e4
1 changed files with 7 additions and 0 deletions
|
|
@ -130,6 +130,13 @@ test "cbor.matchI64 error.IntegerTooLarge" {
|
|||
try expectError(error.IntegerTooLarge, result);
|
||||
}
|
||||
|
||||
test "cbor.matchI64 error.IntegerTooSmall large negative" {
|
||||
var buf = [_]u8{ 0x3B, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
var iter: []const u8 = &buf;
|
||||
var val: i64 = 0;
|
||||
try expectError(error.IntegerTooSmall, matchInt(i64, &iter, &val));
|
||||
}
|
||||
|
||||
test "cbor.matchI64 error.TooShort" {
|
||||
var buf = [_]u8{ 0x19, 0x01 };
|
||||
var iter: []const u8 = &buf;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue