Make tests work again,

This commit is contained in:
Kitteh 2021-06-01 13:06:12 +01:00
parent 7fca728668
commit 5f7b6b015f
2 changed files with 6 additions and 2 deletions

View file

@ -14,8 +14,6 @@ pub fn get_byte(reader: anytype) !u8 {
}
pub fn get_string(reader: anytype, allocator: *std.mem.Allocator) ![]u8 {
var buffer: [1024]u8 = undefined;
return try reader.readUntilDelimiterAlloc(
allocator,
'\x00',

View file

@ -70,6 +70,12 @@ test "read/write stringlist" {
var fBS = std.io.fixedBufferStream(byteList.items);
var val = try read.get_stringlist(fBS.reader(), global_allocator);
defer {
for (val.items) |str| {
global_allocator.free(str);
}
val.deinit();
}
try expect(arr.items.len == val.items.len);
for (arr.items) |str, index| {