mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 04:04:44 +01:00
15 lines
289 B
Zig
15 lines
289 B
Zig
const std = @import("std");
|
|
const expectEqual = std.testing.expectEqual;
|
|
|
|
const Point = struct { x: i32, y: i32 };
|
|
|
|
test "anonymous struct literal" {
|
|
const pt: Point = .{
|
|
.x = 13,
|
|
.y = 67,
|
|
};
|
|
try expectEqual(13, pt.x);
|
|
try expectEqual(67, pt.y);
|
|
}
|
|
|
|
// test
|