zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 59322963cecebecd7ff5474d5fcb53eb561fb686 (tree)
parent 7f3fdd2ff6905cff942138d0da918c6bd25b0916
Author: jim price <shadeops@gmail.com>
Date:   Sun, 23 Jul 2023 00:55:30 -0700

Fix the http.Server test and add it to the set of tests in http.zig

Diffstat:
Mlib/std/http.zig | 1+
Mlib/std/http/Server.zig | 7+++++--
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/std/http.zig b/lib/std/http.zig @@ -274,5 +274,6 @@ const std = @import("std.zig"); test { _ = Client; _ = Method; + _ = Server; _ = Status; } diff --git a/lib/std/http/Server.zig b/lib/std/http/Server.zig @@ -735,9 +735,12 @@ test "HTTP server handles a chunked transfer coding request" { const server_thread = try std.Thread.spawn(.{}, (struct { fn apply(s: *std.http.Server) !void { - const res = try s.accept(.{ .dynamic = max_header_size }); + var res = try s.accept(.{ + .allocator = allocator, + .header_strategy = .{ .dynamic = max_header_size }, + }); defer res.deinit(); - defer res.reset(); + defer _ = res.reset(); try res.wait(); try expect(res.request.transfer_encoding.? == .chunked);