test_struct_result.zig (273B) - Raw
1 const std = @import("std"); 2 const expect = std.testing.expect; 3 4 const Point = struct { x: i32, y: i32 }; 5 6 test "anonymous struct literal" { 7 const pt: Point = .{ 8 .x = 13, 9 .y = 67, 10 }; 11 try expect(pt.x == 13); 12 try expect(pt.y == 67); 13 } 14 15 // test