mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
Fix the http.Server test and add it to the set of tests in http.zig
This commit is contained in:
parent
7f3fdd2ff6
commit
59322963ce
@ -274,5 +274,6 @@ const std = @import("std.zig");
|
|||||||
test {
|
test {
|
||||||
_ = Client;
|
_ = Client;
|
||||||
_ = Method;
|
_ = Method;
|
||||||
|
_ = Server;
|
||||||
_ = Status;
|
_ = Status;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -735,9 +735,12 @@ test "HTTP server handles a chunked transfer coding request" {
|
|||||||
|
|
||||||
const server_thread = try std.Thread.spawn(.{}, (struct {
|
const server_thread = try std.Thread.spawn(.{}, (struct {
|
||||||
fn apply(s: *std.http.Server) !void {
|
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.deinit();
|
||||||
defer res.reset();
|
defer _ = res.reset();
|
||||||
try res.wait();
|
try res.wait();
|
||||||
|
|
||||||
try expect(res.request.transfer_encoding.? == .chunked);
|
try expect(res.request.transfer_encoding.? == .chunked);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user