master
Mike 5 years ago
parent 3dc2e33461
commit 8fd20e3b42

@ -96,3 +96,26 @@ test "BasicGroup creation" {
reg.remove(i32, e0);
std.debug.assert(group.len() == 0);
}
test "BasicGroup exclides" {
var reg = Registry.init(std.testing.allocator);
defer reg.deinit();
var group = reg.group(.{}, .{ i32 }, .{ u32 });
std.testing.expectEqual(group.len(), 0);
var e0 = reg.create();
reg.add(e0, @as(i32, 44));
std.debug.assert(group.len() == 1);
var iterated_entities: usize = 0;
var iter = group.iterator();
while (iter.next()) |entity| {
iterated_entities += 1;
}
std.testing.expectEqual(iterated_entities, 1);
reg.add(e0, @as(u32, 55));
std.debug.assert(group.len() == 0);
}
Loading…
Cancel
Save