This repository was archived by the owner on Apr 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed
Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,13 @@ pub fn onRequestConnect(ctx: *Ctx, res: anyerror!void) anyerror!void {
3838}
3939
4040test "example.com" {
41- // const url = "http://127.0.0.1:8080";
42- const url = "https://www.example.com" ;
41+ var urls = [_ ][]const u8 {
42+ "https://www.example.com" ,
43+ };
44+ try do (& urls );
45+ }
4346
47+ fn do (urls : [][]const u8 ) ! void {
4448 var gpa = std .heap .GeneralPurposeAllocator (.{}){};
4549 defer switch (gpa .deinit ()) {
4650 .ok = > {},
@@ -64,13 +68,16 @@ test "example.com" {
6468
6569 var server_header_buffer : [1024 * 1024 ]u8 = undefined ;
6670
67- try client .async_open (
68- .GET ,
69- try std .Uri .parse (url ),
70- .{ .server_header_buffer = & server_header_buffer },
71- & ctx ,
72- onRequestConnect ,
73- );
71+ for (urls ) | url | {
72+ std .log .info ("request {s}" , .{url });
73+ try client .async_open (
74+ .GET ,
75+ try std .Uri .parse (url ),
76+ .{ .server_header_buffer = & server_header_buffer },
77+ & ctx ,
78+ onRequestConnect ,
79+ );
7480
75- try std .testing .expect (ctx .err == null );
81+ try std .testing .expect (ctx .err == null );
82+ }
7683}
You can’t perform that action at this time.
0 commit comments