| ... | ... | @@ -2590,7 +2590,7 @@ test "write json then parse it" { |
| 2590 | 2590 | try testing.expect(mem.eql(u8, tree.root.Object.get("str").?.String, "hello")); |
| 2591 | 2591 | } |
| 2592 | 2592 | |
| 2593 | | fn test_parse(arena_allocator: *std.mem.Allocator, json_str: []const u8) !Value { |
| 2593 | fn testParse(arena_allocator: *std.mem.Allocator, json_str: []const u8) !Value { |
| 2594 | 2594 | var p = Parser.init(arena_allocator, false); |
| 2595 | 2595 | return (try p.parse(json_str)).root; |
| 2596 | 2596 | } |
| ... | ... | @@ -2598,13 +2598,13 @@ fn test_parse(arena_allocator: *std.mem.Allocator, json_str: []const u8) !Value |
| 2598 | 2598 | test "parsing empty string gives appropriate error" { |
| 2599 | 2599 | var arena_allocator = std.heap.ArenaAllocator.init(std.testing.allocator); |
| 2600 | 2600 | defer arena_allocator.deinit(); |
| 2601 | | try testing.expectError(error.UnexpectedEndOfJson, test_parse(&arena_allocator.allocator, "")); |
| 2601 | try testing.expectError(error.UnexpectedEndOfJson, testParse(&arena_allocator.allocator, "")); |
| 2602 | 2602 | } |
| 2603 | 2603 | |
| 2604 | 2604 | test "integer after float has proper type" { |
| 2605 | 2605 | var arena_allocator = std.heap.ArenaAllocator.init(std.testing.allocator); |
| 2606 | 2606 | defer arena_allocator.deinit(); |
| 2607 | | const json = try test_parse(&arena_allocator.allocator, |
| 2607 | const json = try testParse(&arena_allocator.allocator, |
| 2608 | 2608 | \\{ |
| 2609 | 2609 | \\ "float": 3.14, |
| 2610 | 2610 | \\ "ints": [1, 2, 3] |
| ... | ... | @@ -2639,7 +2639,7 @@ test "escaped characters" { |
| 2639 | 2639 | \\} |
| 2640 | 2640 | ; |
| 2641 | 2641 | |
| 2642 | | const obj = (try test_parse(&arena_allocator.allocator, input)).Object; |
| 2642 | const obj = (try testParse(&arena_allocator.allocator, input)).Object; |
| 2643 | 2643 | |
| 2644 | 2644 | try testing.expectEqualSlices(u8, obj.get("backslash").?.String, "\\"); |
| 2645 | 2645 | try testing.expectEqualSlices(u8, obj.get("forwardslash").?.String, "/"); |