From e6881d4373ce355f3f4565c22c125870ed8fcfc8 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Tue, 11 May 2021 23:09:25 +0200 Subject: [PATCH] std/json: fix previous commit for std.testing changes --- lib/std/json.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/std/json.zig b/lib/std/json.zig index 052d350acb..ed26c13229 100644 --- a/lib/std/json.zig +++ b/lib/std/json.zig @@ -1995,17 +1995,17 @@ test "parse into struct with duplicate field" { const ballast = try testing.allocator.alloc(u64, 1); defer testing.allocator.free(ballast); - const options = ParseOptions{ + const options = ParseOptions{ .allocator = testing.allocator, .duplicate_field_behavior = .UseLast, }; const str = "{ \"a\": 1, \"a\": 0.25 }"; - + const T1 = struct { a: *u64 }; - testing.expectError(error.UnexpectedToken, parse(T1, &TokenStream.init(str), options)); + try testing.expectError(error.UnexpectedToken, parse(T1, &TokenStream.init(str), options)); const T2 = struct { a: f64 }; - testing.expectEqual(T2{ .a = 0.25 }, try parse(T2, &TokenStream.init(str), options)); + try testing.expectEqual(T2{ .a = 0.25 }, try parse(T2, &TokenStream.init(str), options)); } /// A non-stream JSON parser which constructs a tree of Value's.