zig/doc/langref/test_packed_struct_equality.zig
2024-10-12 20:59:12 -07:00

15 lines
274 B
Zig

const std = @import("std");
const expect = std.testing.expect;
test "packed struct equality" {
const S = packed struct {
a: u4,
b: u4,
};
const x: S = .{ .a = 1, .b = 2 };
const y: S = .{ .b = 2, .a = 1 };
try expect(x == y);
}
// test