mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
std: testing.expectEqual on structs now works
This commit is contained in:
parent
ebedc99ac1
commit
a712a5515d
@ -78,8 +78,10 @@ pub fn expectEqual(expected: var, actual: @typeOf(expected)) void {
|
||||
|
||||
TypeId.Array => |array| expectEqualSlices(array.child, &expected, &actual),
|
||||
|
||||
TypeId.Struct => {
|
||||
@compileError("TODO implement testing.expectEqual for structs");
|
||||
TypeId.Struct => |structType| {
|
||||
inline for (structType.fields) |field| {
|
||||
expectEqual(@field(expected, field.name), @field(actual, field.name));
|
||||
}
|
||||
},
|
||||
|
||||
TypeId.Union => |union_info| {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user