authorgravatar for noam@pixelhero.devNoam Preil <noam@pixelhero.dev> 2020-06-27 21:15:07-04:00
committergravatar for noam@pixelhero.devNoam Preil <noam@pixelhero.dev> 2020-06-27 21:15:23-04:00
log1861c25142650c71a99e259367ae2fd9ea601c1b
tree70e5ecb21ecf60c5bdf3871e19f23ada541ee157
parent97c41e71521a66e3e117bc23cf51d047b119eb9a
signature Commit is signed but in an unrecognized format.

Improve Tranform failure output


1 files changed, 13 insertions(+), 2 deletions(-)

src-self-hosted/test.zig+13-2
......@@ -465,8 +465,19 @@ pub const TestContext = struct {
465465
466466 var test_node = update_node.start("assert", null);
467467 test_node.activate();
468 std.testing.expectEqualSlices(u8, expected_output, out_zir.items);
469 test_node.end();
468 defer test_node.end();
469 if (expected_output.len != out_zir.items.len) {
470 std.debug.warn("{}\nTransformed ZIR length differs:\n================\nExpected:\n================\n{}\n================\nFound: {}\n================\nTest failed.\n", .{ case.name, expected_output, out_zir.items });
471 std.process.exit(1);
472 }
473 for (expected_output) |e, i| {
474 if (out_zir.items[i] != e) {
475 if (expected_output.len != out_zir.items.len) {
476 std.debug.warn("{}\nTransformed ZIR differs:\n================\nExpected:\n================\n{}\n================\nFound: {}\n================\nTest failed.\n", .{ case.name, expected_output, out_zir.items });
477 std.process.exit(1);
478 }
479 }
480 }
470481 },
471482 .Error => |e| {
472483 var test_node = update_node.start("assert", null);