fix style warning in json.zig

This commit is contained in:
Tizoner 2021-07-17 17:43:50 +09:00 committed by Veikka Tuominen
parent 95e5fac412
commit c905056562

View File

@ -2590,7 +2590,7 @@ test "write json then parse it" {
try testing.expect(mem.eql(u8, tree.root.Object.get("str").?.String, "hello"));
}
fn test_parse(arena_allocator: *std.mem.Allocator, json_str: []const u8) !Value {
fn testParse(arena_allocator: *std.mem.Allocator, json_str: []const u8) !Value {
var p = Parser.init(arena_allocator, false);
return (try p.parse(json_str)).root;
}
@ -2598,13 +2598,13 @@ fn test_parse(arena_allocator: *std.mem.Allocator, json_str: []const u8) !Value
test "parsing empty string gives appropriate error" {
var arena_allocator = std.heap.ArenaAllocator.init(std.testing.allocator);
defer arena_allocator.deinit();
try testing.expectError(error.UnexpectedEndOfJson, test_parse(&arena_allocator.allocator, ""));
try testing.expectError(error.UnexpectedEndOfJson, testParse(&arena_allocator.allocator, ""));
}
test "integer after float has proper type" {
var arena_allocator = std.heap.ArenaAllocator.init(std.testing.allocator);
defer arena_allocator.deinit();
const json = try test_parse(&arena_allocator.allocator,
const json = try testParse(&arena_allocator.allocator,
\\{
\\ "float": 3.14,
\\ "ints": [1, 2, 3]
@ -2639,7 +2639,7 @@ test "escaped characters" {
\\}
;
const obj = (try test_parse(&arena_allocator.allocator, input)).Object;
const obj = (try testParse(&arena_allocator.allocator, input)).Object;
try testing.expectEqualSlices(u8, obj.get("backslash").?.String, "\\");
try testing.expectEqualSlices(u8, obj.get("forwardslash").?.String, "/");