zig/test/behavior/bugs/624.zig

24 lines
447 B
Zig
Raw Normal View History

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 {
return struct {
n: usize,
};
}
test "foo" {
var allocator = ContextAllocator{ .n = 10 };
try expect(allocator.n == 10);
}