master
1const std = @import("std");
2const expect = std.testing.expect;
3
4test "namespaced container level variable" {
5 try expect(foo() == 1235);
6 try expect(foo() == 1236);
7}
8
9const S = struct {
10 var x: i32 = 1234;
11};
12
13fn foo() i32 {
14 S.x += 1;
15 return S.x;
16}
17
18// test