mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
14 lines
222 B
Zig
14 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
|