mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
13 lines
222 B
Zig
13 lines
222 B
Zig
const expect = @import("std").testing.expect;
|
|
|
|
test "comptime pointers" {
|
|
comptime {
|
|
var x: i32 = 1;
|
|
const ptr = &x;
|
|
ptr.* += 1;
|
|
x += 1;
|
|
try expect(ptr.* == 3);
|
|
}
|
|
}
|
|
|
|
// test
|