From 9767e2a21bc045716929077ba7e9ccc451eb2434 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 12 Mar 2026 19:30:04 +0100 Subject: [PATCH] refactor: add a test for short reads of floats in skipValue --- test/tests.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/tests.zig b/test/tests.zig index a0378f0..d981911 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -130,6 +130,11 @@ test "cbor.matchI64 error.IntegerTooLarge" { 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" { var buf = [_]u8{ 0x3B, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; var iter: []const u8 = &buf;