| author | |
| committer | |
| log | e1b258f39fcb4fff97a4fcf6ee9db10bb71646cc |
| tree | 9f24414972de1eab0ef26053fe1784dace056d1d |
| parent | 8fef23a5250efc38b16b720f298a61d793ace4e3 |
| signature |
closes #6242 files changed, 24 insertions(+), 0 deletions(-)
test/stage1/behavior.zig+1| ... | ... | @@ -32,6 +32,7 @@ comptime { |
| 32 | 32 | _ = @import("behavior/bugs/394.zig"); |
| 33 | 33 | _ = @import("behavior/bugs/421.zig"); |
| 34 | 34 | _ = @import("behavior/bugs/529.zig"); |
| 35 | _ = @import("behavior/bugs/624.zig"); | |
| 35 | 36 | _ = @import("behavior/bugs/655.zig"); |
| 36 | 37 | _ = @import("behavior/bugs/656.zig"); |
| 37 | 38 | _ = @import("behavior/bugs/679.zig"); |
test/stage1/behavior/bugs/624.zig created+23| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | const std = @import("std"); | |
| 2 | const expect = std.testing.expect; | |
| 3 | ||
| 4 | const TestContext = struct { | |
| 5 | server_context: *ListenerContext, | |
| 6 | }; | |
| 7 | ||
| 8 | const ListenerContext = struct { | |
| 9 | context_alloc: *ContextAllocator, | |
| 10 | }; | |
| 11 | ||
| 12 | const ContextAllocator = MemoryPool(TestContext); | |
| 13 | ||
| 14 | fn MemoryPool(comptime T: type) type { | |
| 15 | return struct { | |
| 16 | n: usize, | |
| 17 | }; | |
| 18 | } | |
| 19 | ||
| 20 | test "foo" { | |
| 21 | var allocator = ContextAllocator{ .n = 10 }; | |
| 22 | expect(allocator.n == 10); | |
| 23 | } |