|
|
|
@ -82,12 +82,12 @@ test "singletons" {
|
|
|
|
|
defer reg.deinit();
|
|
|
|
|
|
|
|
|
|
var pos = Position{ .x = 5, .y = 5 };
|
|
|
|
|
reg.singletons.add(pos);
|
|
|
|
|
try std.testing.expect(reg.singletons.has(Position));
|
|
|
|
|
try std.testing.expectEqual(reg.singletons.get(Position).*, pos);
|
|
|
|
|
reg.singletons().add(pos);
|
|
|
|
|
try std.testing.expect(reg.singletons().has(Position));
|
|
|
|
|
try std.testing.expectEqual(reg.singletons().get(Position).*, pos);
|
|
|
|
|
|
|
|
|
|
reg.singletons.remove(Position);
|
|
|
|
|
try std.testing.expect(!reg.singletons.has(Position));
|
|
|
|
|
reg.singletons().remove(Position);
|
|
|
|
|
try std.testing.expect(!reg.singletons().has(Position));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
test "destroy" {
|
|
|
|
|