aboutsummaryrefslogtreecommitdiff
path: root/doc/langref/test_packed_struct_equality.zig
blob: d1c755af195fda809467c423b1adaf05aeb43460 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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