Skip to content

Commit d7bce71

Browse files
committed
Fixes
1 parent ba1d676 commit d7bce71

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

build.zig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ pub fn build(b: *std.Build) void {
5757
// Skip main.zig since it's already covered by exe_unit_tests
5858
if (std.mem.endsWith(u8, zig_file, "/main.zig")) continue;
5959
const test_artifact = b.addTest(.{ .root_source_file = b.path(zig_file), .target = target, .optimize = optimize });
60+
61+
// Add dependencies to individual test artifacts
62+
for (dependencies) |dependency| {
63+
const dep = b.dependency(dependency, .{});
64+
test_artifact.root_module.addImport(dependency, dep.module(dependency));
65+
}
66+
6067
const run_test = b.addRunArtifact(test_artifact);
6168
test_run_steps.append(&run_test.step) catch unreachable;
6269
}

src/httpfile/assertion_checker.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ fn matchesRegex(text: []const u8, pattern: []const u8) bool {
1616
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
1717
defer arena.deinit();
1818
const allocator = arena.allocator();
19-
const compiled_regex = regex.Regex.compile(allocator, pattern) catch return false;
19+
var compiled_regex = regex.Regex.compile(allocator, pattern) catch return false;
2020
defer compiled_regex.deinit();
2121

22-
return compiled_regex.match(text);
22+
return compiled_regex.match(text) catch return false;
2323
}
2424

2525
pub fn check(request: *HttpParser.HttpRequest, response: Client.HttpResponse) !void {

0 commit comments

Comments
 (0)