@@ -89,7 +89,7 @@ fn parseHttpResponse(alloc: std.mem.Allocator, json_str: []const u8) !Client.Htt
8989 var parsed = std .json .parseFromSlice (std .json .Value , alloc , json_str , .{}) catch | err | {
9090 const error_msg = std .fmt .allocPrint (alloc , "Failed to parse response JSON: {s}" , .{@errorName (err )}) catch "Failed to parse response JSON" ;
9191 defer alloc .free (error_msg );
92- logErrorToConsole (error_msg );
92+ consoleError (error_msg , error_msg . len );
9393 return error .InvalidResponseJson ;
9494 };
9595 defer parsed .deinit ();
@@ -176,7 +176,7 @@ export fn executeHttpSpecComplete(content_ptr: [*]const u8, content_len: usize)
176176 // Don't defer free - the TestResult needs to keep the string
177177
178178 results .append (TestResult .init (request_name , false , error_msg , null )) catch {
179- logErrorToConsole ("Failed to append test result" );
179+ consoleError ("Failed to append test result" , 30 );
180180 continue ;
181181 };
182182 continue ;
@@ -192,15 +192,15 @@ export fn executeHttpSpecComplete(content_ptr: [*]const u8, content_len: usize)
192192 // Don't defer free - the TestResult needs to keep the string
193193
194194 results .append (TestResult .init (request_name , false , error_msg , status_code )) catch {
195- logErrorToConsole ("Failed to append test result" );
195+ consoleError ("Failed to append test result" , 30 );
196196 continue ;
197197 };
198198 continue ;
199199 };
200200
201201 // All assertions passed
202202 results .append (TestResult .init (request_name , true , null , status_code )) catch {
203- logErrorToConsole ("Failed to append test result" );
203+ consoleError ("Failed to append test result" , 30 );
204204 continue ;
205205 };
206206 }
@@ -262,11 +262,6 @@ export fn getResultLength() usize {
262262}
263263
264264
265- /// Test function to verify WASM is working
266- export fn testWasm () i32 {
267- consoleLog ("WASM module loaded successfully!" , 30 );
268- return 42 ;
269- }
270265
271266/// Console error writer for assertion failures
272267const ConsoleErrorWriter = struct {
@@ -284,24 +279,5 @@ const ConsoleErrorWriter = struct {
284279 }
285280};
286281
287- /// Logging helper functions for debugging
288- fn logToConsole (message : []const u8 ) void {
289- consoleLog (message .ptr , message .len );
290- }
291-
292- fn logErrorToConsole (message : []const u8 ) void {
293- consoleError (message .ptr , message .len );
294- }
295282
296- /// Test function for basic HTTPSpec parsing
297- export fn testHttpSpecParsing () [* ]const u8 {
298- const test_content =
299- \\### Test request
300- \\GET https://httpbin.org/status/200
301- \\
302- \\//# status == 200
303- ;
304-
305- return executeHttpSpecComplete (test_content .ptr , test_content .len );
306- }
307283
0 commit comments