mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 04:04:44 +01:00
18 lines
292 B
Zig
18 lines
292 B
Zig
const std = @import("std");
|
|
const expectEqual = std.testing.expectEqual;
|
|
|
|
test "namespaced container level variable" {
|
|
try expectEqual(1235, foo());
|
|
try expectEqual(1236, foo());
|
|
}
|
|
|
|
const S = struct {
|
|
var x: i32 = 1234;
|
|
};
|
|
|
|
fn foo() i32 {
|
|
S.x += 1;
|
|
return S.x;
|
|
}
|
|
|
|
// test
|