std.json add stringify struct with string as array

This commit is contained in:
OfekShochat 2022-04-19 08:15:30 +03:00 committed by Andreas Reischuck
parent 62453496ba
commit b57a356bb6

View File

@ -3268,6 +3268,11 @@ test "stringify struct" {
}{ .foo = 42 }, StringifyOptions{});
}
test "stringify struct with string as array" {
try teststringify("{\"foo\":\"bar\"}", .{ .foo = "bar" }, StringifyOptions{});
try teststringify("{\"foo\":[98,97,114]}", .{ .foo = "bar" }, StringifyOptions{ .string = .Array });
}
test "stringify struct with indentation" {
try teststringify(
\\{