From e29829f2a0144a974a00d7b2372e3a03a015d98d Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Mon, 25 Aug 2025 10:00:50 -0700 Subject: [PATCH] fix failing s3 test Not quite sure the problem I saw earlier in aws.zig, but the data entering that switch prong is []const u8, so it is fine for what we are doing --- src/aws.zig | 6 +----- src/aws_test.zig | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/aws.zig b/src/aws.zig index 14e5760..5fb8791 100644 --- a/src/aws.zig +++ b/src/aws.zig @@ -898,11 +898,7 @@ fn generalAllocPrint(allocator: std.mem.Allocator, val: anytype) !?[]const u8 { .one => return try std.fmt.allocPrint(allocator, "{s}", .{val}), .many => return try std.fmt.allocPrint(allocator, "{s}", .{val}), .slice => { - log.warn( - "printing object of type [][]const u8...pretty sure this is wrong: {any}", - .{val}, - ); - return try std.fmt.allocPrint(allocator, "{any}", .{val}); + return try std.fmt.allocPrint(allocator, "{s}", .{val}); }, .c => return try std.fmt.allocPrint(allocator, "{s}", .{val}), }, diff --git a/src/aws_test.zig b/src/aws_test.zig index d57e641..d01b2f4 100644 --- a/src/aws_test.zig +++ b/src/aws_test.zig @@ -1101,7 +1101,7 @@ test "rest_xml_with_input: S3 put object" { // I don't think this will work since we're overriding the url // try req_actuals.expectHeader("Host", "mysfitszj3t6webstack-hostingbucketa91a61fe-1ep3ezkgwpxr0.s3.us-west-2.amazonaws.com"); try req_actuals.expectHeader("x-amz-storage-class", "STANDARD"); - try std.testing.expectEqualStrings("/mysfitszj3t6webstack-hostingbucketa91a61fe-1ep3ezkgwpxr0/i/am/a/teapot/foo?x-id=PutObject", req_actuals.request_uri); + try std.testing.expectEqualStrings("https://mysfitszj3t6webstack-hostingbucketa91a61fe-1ep3ezkgwpxr0.s3.us-west-2.amazonaws.com/i/am/a/teapot/foo?x-id=PutObject", req_actuals.request_uri); try std.testing.expectEqualStrings("bar", req_actuals.body.?); // Response expectations try std.testing.expectEqualStrings("9PEYBAZ9J7TPRX43, host_id: jdRDo30t7Ge9lf6F+4WYpg+YKui8z0mz2+rwinL38xDZzvloJqrmpCAiKG375OSvHA9OBykJS44=", result.response_metadata.request_id);