Skip to content

Commit

Permalink
fix: how to get data len
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun committed May 31, 2023
1 parent 5e3271f commit 33650ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bindings/zig/src/opendal.zig
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ test "Opendal BDD test" {
var r: opendal.opendal_result_read = opendal.opendal_operator_blocking_read(testkit.p, testkit.path);
defer opendal.opendal_bytes_free(r.data);
try testing.expect(r.code == opendal.OPENDAL_OK);
try testing.expectEqual(std.mem.len(r.data.*.data), std.mem.len(testkit.content));
try testing.expectEqual(std.mem.len(testkit.content), r.data.*.len);

var count: usize = 0;
while (count < std.mem.len(r.data.*.data)) : (count += 1) {
while (count < r.data.*.len) : (count += 1) {
try testing.expectEqual(testkit.content[count], r.data.*.data[count]);
}
}

0 comments on commit 33650ae

Please sign in to comment.