zig/test/behavior/bugs/624.zig
2021-06-21 17:03:03 -07:00

25 lines
458 B
Zig

const std = @import("std");
const expect = std.testing.expect;
const TestContext = struct {
server_context: *ListenerContext,
};
const ListenerContext = struct {
context_alloc: *ContextAllocator,
};
const ContextAllocator = MemoryPool(TestContext);
fn MemoryPool(comptime T: type) type {
_ = T;
return struct {
n: usize,
};
}
test "foo" {
var allocator = ContextAllocator{ .n = 10 };
try expect(allocator.n == 10);
}