| 1 | const std = @import("std"); |
| 2 | const expect = std.testing.expect; |
| 3 | const expectEqual = std.testing.expectEqual; |
| 4 | |
| 5 | test "fully anonymous struct" { |
| 6 | try check(.{ |
| 7 | .int = @as(u32, 1234), |
| 8 | .float = @as(f64, 12.34), |
| 9 | .b = true, |
| 10 | .s = "hi", |
| 11 | }); |
| 12 | } |
| 13 | |
| 14 | fn check(args: anytype) !void { |
| 15 | try expectEqual(1234, args.int); |
| 16 | try expectEqual(12.34, args.float); |
| 17 | try expect(args.b); |
| 18 | try expectEqual('h', args.s[0]); |
| 19 | try expectEqual('i', args.s[1]); |
| 20 | } |
| 21 | |
| 22 | // test |