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

This commit is contained in:
jim price 2023-07-23 00:55:30 -07:00 committed by Andrew Kelley
parent 7f3fdd2ff6
commit 59322963ce
2 changed files with 6 additions and 2 deletions

View File

@ -274,5 +274,6 @@ const std = @import("std.zig");
test {
_ = Client;
_ = Method;
_ = Server;
_ = Status;
}

View File

@ -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);