Say I have a struct with some fields:
const S = struct {
a: u32,
b: u32,
};
I am comparing them for equality during testing using std.testing.expectEqualDeep
, however, for some particular test I want the equality to skip the comparison of a particular field. Is there a way to achieve this?
Hypothetically I am looking for something like this:
const one: S = .{ .a = 1, .b = 2 };
const two: S = .{ .a = 1, .b = std.testing.ANY };
try std.testing.expectEqualDeep(one, two); // Passes for any value of one.b