diff options
| author | Techatrix <19954306+Techatrix@users.noreply.github.com> | 2023-07-04 21:10:39 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-07-10 10:50:57 -0700 |
| commit | 3bf0b8eada9ec97d4413fed5be29f5e2af30dce1 (patch) | |
| tree | abb28345bbfebf4e87a77156b94bb2426da8533d /lib/std/json/stringify_test.zig | |
| parent | 2b8c1f0d4619565255b9faff2d24bc2360012552 (diff) | |
| download | zig-3bf0b8eada9ec97d4413fed5be29f5e2af30dce1.tar.gz zig-3bf0b8eada9ec97d4413fed5be29f5e2af30dce1.zip | |
explicitly specify error set of `std.json.stringify`
Diffstat (limited to 'lib/std/json/stringify_test.zig')
| -rw-r--r-- | lib/std/json/stringify_test.zig | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/lib/std/json/stringify_test.zig b/lib/std/json/stringify_test.zig index 7fff97f13e..19f8f06e5e 100644 --- a/lib/std/json/stringify_test.zig +++ b/lib/std/json/stringify_test.zig @@ -260,23 +260,6 @@ fn teststringify(expected: []const u8, value: anytype, options: StringifyOptions if (vos.expected_remaining.len > 0) return error.NotEnoughData; } -test "stringify struct with custom stringify that returns a custom error" { - var ret = stringify(struct { - field: Field = .{}, - - pub const Field = struct { - field: ?[]*Field = null, - - const Self = @This(); - pub fn jsonStringify(_: Self, _: StringifyOptions, _: anytype) error{CustomError}!void { - return error.CustomError; - } - }; - }{}, StringifyOptions{}, std.io.null_writer); - - try std.testing.expectError(error.CustomError, ret); -} - test "stringify alloc" { const allocator = std.testing.allocator; const expected = |
