Skip to content

Commit f96187c

Browse files
mochalinsTechatrix
andauthored
Handle builtin fields error_set rename
Co-authored-by: Techatrix <[email protected]>
1 parent 8292bd6 commit f96187c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/parser.zig

+4-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,10 @@ fn expectParseEqual(comptime T: type, comptime expected: anytype, s: []const u8)
362362
defer arena_allocator.deinit();
363363
const arena = arena_allocator.allocator();
364364

365-
if (@typeInfo(@TypeOf(expected)) != .error_set) {
365+
const std_builtin_type_rename = comptime std.SemanticVersion.parse("0.14.0-dev.1346+31fef6f11") catch unreachable;
366+
const error_set_tag = comptime if (@import("builtin").zig_version.order(std_builtin_type_rename) == .lt) .ErrorSet else .error_set;
367+
368+
if (@typeInfo(@TypeOf(expected)) != error_set_tag) {
366369
const actual_from_slice = try std.json.parseFromSliceLeaky(T, arena, s, .{});
367370
try std.testing.expectEqualDeep(@as(T, expected), actual_from_slice);
368371

0 commit comments

Comments
 (0)