I'm trying to write table-based test cases. It doesn't seem like it's possible to write
const tt = [_]MyTestCase {
MyTestCase {
.name = "Test #1: It should do the thing",
.inputs = /* muh inputs */,
.options = /* muh options */,
.expected = "expected output (A)",
},
MyTestCase {
.name = "Test #2: It really shouldn't do this other thing",
...
}
};
inline for (tt) |t| {
test t.name {
const actual = try doMuhThing(t.inputs, t.options);
expect(std.mem.eql(u8, t.expected, actual));
}
}
Would I need to stick my for loop inside one test?