Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions echo-core-zig/src/data/arraylist.zig
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,13 @@ test "ArrayList get out of bounds" {
try std.testing.expectEqual(@as(?*const i32, null), list.get(1));
try std.testing.expectEqual(@as(?*const i32, null), list.get(100));
}

test "ArrayList clear and pop" {
var list = ArrayList(i32).init(std.testing.allocator);
defer list.deinit();

try list.append(1);
list.clear();

try std.testing.expectEqual(@as(?i32, null), list.pop());
}