re-enable whatever test that was
This commit is contained in:
parent
18a0ed5ce4
commit
b2bd779de7
70
src/aws.zig
70
src/aws.zig
|
@ -1120,41 +1120,41 @@ fn reportTraffic(allocator: std.mem.Allocator, info: []const u8, request: awshtt
|
||||||
reporter("{s}\n", .{msg.items});
|
reporter("{s}\n", .{msg.items});
|
||||||
}
|
}
|
||||||
|
|
||||||
// // TODO: Where does this belong really?
|
// TODO: Where does this belong really?
|
||||||
// fn typeForField(comptime T: type, field_name: []const u8) !type {
|
fn typeForField(comptime T: type, comptime field_name: []const u8) !type {
|
||||||
// const ti = @typeInfo(T);
|
const ti = @typeInfo(T);
|
||||||
// switch (ti) {
|
switch (ti) {
|
||||||
// .Struct => {
|
.Struct => {
|
||||||
// inline for (ti.Struct.fields) |field| {
|
inline for (ti.Struct.fields) |field| {
|
||||||
// if (std.mem.eql(u8, field.name, field_name))
|
if (std.mem.eql(u8, field.name, field_name))
|
||||||
// return field.type;
|
return field.type;
|
||||||
// }
|
}
|
||||||
// },
|
},
|
||||||
// else => return error.TypeIsNotAStruct, // should not hit this
|
else => return error.TypeIsNotAStruct, // should not hit this
|
||||||
// }
|
}
|
||||||
// return error.FieldNotFound;
|
return error.FieldNotFound;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// test "custom serialization for map objects" {
|
test "custom serialization for map objects" {
|
||||||
// const allocator = std.testing.allocator;
|
const allocator = std.testing.allocator;
|
||||||
// var buffer = std.ArrayList(u8).init(allocator);
|
var buffer = std.ArrayList(u8).init(allocator);
|
||||||
// defer buffer.deinit();
|
defer buffer.deinit();
|
||||||
// var tags = try std.ArrayList(@typeInfo(try typeForField(services.lambda.tag_resource.Request, "tags")).Pointer.child).initCapacity(allocator, 2);
|
var tags = try std.ArrayList(@typeInfo(try typeForField(services.lambda.tag_resource.Request, "tags")).Pointer.child).initCapacity(allocator, 2);
|
||||||
// defer tags.deinit();
|
defer tags.deinit();
|
||||||
// tags.appendAssumeCapacity(.{ .key = "Foo", .value = "Bar" });
|
tags.appendAssumeCapacity(.{ .key = "Foo", .value = "Bar" });
|
||||||
// tags.appendAssumeCapacity(.{ .key = "Baz", .value = "Qux" });
|
tags.appendAssumeCapacity(.{ .key = "Baz", .value = "Qux" });
|
||||||
// const req = services.lambda.tag_resource.Request{ .resource = "hello", .tags = tags.items };
|
const req = services.lambda.tag_resource.Request{ .resource = "hello", .tags = tags.items };
|
||||||
// try json.stringify(req, .{ .whitespace = .{} }, buffer.writer());
|
try json.stringify(req, .{ .whitespace = .{} }, buffer.writer());
|
||||||
// try std.testing.expectEqualStrings(
|
try std.testing.expectEqualStrings(
|
||||||
// \\{
|
\\{
|
||||||
// \\ "Resource": "hello",
|
\\ "Resource": "hello",
|
||||||
// \\ "Tags": {
|
\\ "Tags": {
|
||||||
// \\ "Foo": "Bar",
|
\\ "Foo": "Bar",
|
||||||
// \\ "Baz": "Qux"
|
\\ "Baz": "Qux"
|
||||||
// \\ }
|
\\ }
|
||||||
// \\}
|
\\}
|
||||||
// , buffer.items);
|
, buffer.items);
|
||||||
// }
|
}
|
||||||
|
|
||||||
test "REST Json v1 builds proper queries" {
|
test "REST Json v1 builds proper queries" {
|
||||||
const allocator = std.testing.allocator;
|
const allocator = std.testing.allocator;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user