commit e6881d4373ce355f3f4565c22c125870ed8fcfc8 (tree)
parent 1b87d4549468d37d8673b2e69611e0f2688ed6c5
Author: Isaac Freund <ifreund@ifreund.xyz>
Date: Tue, 11 May 2021 23:09:25 +0200
std/json: fix previous commit for std.testing changes
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git 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.