| 1 | const std = @import("std"); |
| 2 | const expectEqual = std.testing.expectEqual; |
| 3 | |
| 4 | test "packed union equality" { |
| 5 | const U = packed union { |
| 6 | a: u4, |
| 7 | b: i4, |
| 8 | }; |
| 9 | const x: U = .{ .a = 3 }; |
| 10 | const y: U = .{ .b = 3 }; |
| 11 | try expectEqual(x, y); |
| 12 | } |
| 13 | |
| 14 | // test |