about summary refs log tree commit diff
path: root/lang/zig/struct-result.zig
blob: fcd556a9c207c3ffc62857b3f6fb378fc9eedff5 (plain) (blame)
1
2
3
4
5
6
7
const expect = @import("std").testing.expect;
const Point = struct { x: i32, y: i32 };

test "anonymous struct literal" {
    const pt: Point = .{ .x = 13, .y = 67 };
    expect(pt.x + pt.y == 80);
}