authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-05-11 23:09:25+02:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-05-11 23:09:25+02:00
loge6881d4373ce355f3f4565c22c125870ed8fcfc8
treeb7e81023ca213b83cdd1aac1025c1688fa38746d
parent1b87d4549468d37d8673b2e69611e0f2688ed6c5
signaturelock-open Commit is signed but in an unrecognized format.

std/json: fix previous commit for std.testing changes


1 files changed, 4 insertions(+), 4 deletions(-)

lib/std/json.zig+4-4
......@@ -1995,17 +1995,17 @@ test "parse into struct with duplicate field" {
19951995 const ballast = try testing.allocator.alloc(u64, 1);
19961996 defer testing.allocator.free(ballast);
19971997
1998 const options = ParseOptions{
1998 const options = ParseOptions{
19991999 .allocator = testing.allocator,
20002000 .duplicate_field_behavior = .UseLast,
20012001 };
20022002 const str = "{ \"a\": 1, \"a\": 0.25 }";
2003
2003
20042004 const T1 = struct { a: *u64 };
2005 testing.expectError(error.UnexpectedToken, parse(T1, &TokenStream.init(str), options));
2005 try testing.expectError(error.UnexpectedToken, parse(T1, &TokenStream.init(str), options));
20062006
20072007 const T2 = struct { a: f64 };
2008 testing.expectEqual(T2{ .a = 0.25 }, try parse(T2, &TokenStream.init(str), options));
2008 try testing.expectEqual(T2{ .a = 0.25 }, try parse(T2, &TokenStream.init(str), options));
20092009}
20102010
20112011/// A non-stream JSON parser which constructs a tree of Value's.