fn testLeb128Encoding(comptime T: type, value: T, encoding: []const u8) !void
fn testLeb128Encoding(comptime T: type, value: T, encoding: []const u8) !void { const info = @typeInfo(T).int; const max_bytes = @divFloor(info.bits -| 1, 7) + 1; var bytes: [max_bytes]u8 = undefined; var fw: Writer = .fixed(&bytes); try writeLeb128(&fw, value); try std.testing.expectEqualSlices(u8, encoding, fw.buffered()); }