Merge pull request #11729 from ziglang/fix-test-harness

test: correctly track identical error msgs in handled errors list
This commit is contained in:
Jakub Konka 2022-05-26 21:00:40 +02:00 committed by GitHub
commit 326b2aa27b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -1574,6 +1574,8 @@ pub const TestContext = struct {
for (actual_errors.list) |actual_error| {
for (case_error_list) |case_msg, i| {
if (handled_errors[i]) continue;
const ex_tag: std.meta.Tag(@TypeOf(case_msg)) = case_msg;
switch (actual_error) {
.src => |actual_msg| {

View File

@ -36,7 +36,7 @@ fn parseFree(comptime T: type, value: T, allocator: std.mem.Allocator) void {
}
pub export fn entry() void {
const allocator = std.testing.allocator_instance.allocator();
const allocator = std.testing.failing_allocator;
_ = parse(std.StringArrayHashMap(bool), allocator) catch return;
}