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