| ... | @@ -336,17 +336,17 @@ test "Server.Request.respondStreaming non-chunked, unknown content-length" { | ... | @@ -336,17 +336,17 @@ test "Server.Request.respondStreaming non-chunked, unknown content-length" { |
| 336 | const response = try stream_reader.interface.allocRemaining(gpa, .unlimited); | 336 | const response = try stream_reader.interface.allocRemaining(gpa, .unlimited); |
| 337 | defer gpa.free(response); | 337 | defer gpa.free(response); |
| 338 | | 338 | |
| 339 | var expected_response = std.array_list.Managed(u8).init(gpa); | 339 | var expected_response: std.ArrayList(u8) = .empty; |
| 340 | defer expected_response.deinit(); | 340 | defer expected_response.deinit(gpa); |
| 341 | | 341 | |
| 342 | try expected_response.appendSlice("HTTP/1.1 200 OK\r\nconnection: close\r\n\r\n"); | 342 | try expected_response.appendSlice(gpa, "HTTP/1.1 200 OK\r\nconnection: close\r\n\r\n"); |
| 343 | | 343 | |
| 344 | { | 344 | { |
| 345 | var total: usize = 0; | 345 | var total: usize = 0; |
| 346 | for (0..500) |i| { | 346 | for (0..500) |i| { |
| 347 | var buf: [30]u8 = undefined; | 347 | var buf: [30]u8 = undefined; |
| 348 | const line = try std.mem.print(&buf, "{d}, ah ha ha!\n", .{i}); | 348 | const line = try std.mem.print(&buf, "{d}, ah ha ha!\n", .{i}); |
| 349 | try expected_response.appendSlice(line); | 349 | try expected_response.appendSlice(gpa, line); |
| 350 | total += line.len; | 350 | total += line.len; |
| 351 | } | 351 | } |
| 352 | try expectEqual(7390, total); | 352 | try expectEqual(7390, total); |
| ... | @@ -411,12 +411,12 @@ test "receiving arbitrary http headers from the client" { | ... | @@ -411,12 +411,12 @@ test "receiving arbitrary http headers from the client" { |
| 411 | const response = try stream_reader.interface.allocRemaining(gpa, .unlimited); | 411 | const response = try stream_reader.interface.allocRemaining(gpa, .unlimited); |
| 412 | defer gpa.free(response); | 412 | defer gpa.free(response); |
| 413 | | 413 | |
| 414 | var expected_response = std.array_list.Managed(u8).init(gpa); | 414 | var expected_response: std.ArrayList(u8) = .empty; |
| 415 | defer expected_response.deinit(); | 415 | defer expected_response.deinit(gpa); |
| 416 | | 416 | |
| 417 | try expected_response.appendSlice("HTTP/1.1 200 OK\r\n"); | 417 | try expected_response.appendSlice(gpa, "HTTP/1.1 200 OK\r\n"); |
| 418 | try expected_response.appendSlice("connection: close\r\n"); | 418 | try expected_response.appendSlice(gpa, "connection: close\r\n"); |
| 419 | try expected_response.appendSlice("content-length: 0\r\n\r\n"); | 419 | try expected_response.appendSlice(gpa, "content-length: 0\r\n\r\n"); |
| 420 | try expectEqualStrings(expected_response.items, response); | 420 | try expectEqualStrings(expected_response.items, response); |
| 421 | } | 421 | } |
| 422 | | 422 | |