aboutsummaryrefslogtreecommitdiff
path: root/lib/std/json/test.zig
AgeCommit message (Collapse)Author
2025-07-19std.json: update to new I/O APIAndrew Kelley
also do a little bit of namespace cleanup
2024-07-03json: respect duplicate_field_behavior in std.json.Value.jsonParseTechatrix
2023-10-26x86_64: fix behavior of `getValue`Jacob Young
Old behavior renamed to `getValueIfFree`.
2023-10-23x86_64: implement enough to pass unicode testsJacob Young
* implement vector comparison * implement reduce for bool vectors * fix `@memcpy` bug * enable passing std tests
2023-10-22Revert "Revert "Merge pull request #17637 from jacobly0/x86_64-test-std""Jacob Young
This reverts commit 6f0198cadbe29294f2bf3153a27beebd64377566.
2023-10-22Revert "Merge pull request #17637 from jacobly0/x86_64-test-std"Andrew Kelley
This reverts commit 0c99ba1eab63865592bb084feb271cd4e4b0357e, reversing changes made to 5f92b070bf284f1493b1b5d433dd3adde2f46727. This caused a CI failure when it landed in master branch due to a 128-bit `@byteSwap` in std.mem.
2023-10-21x86_64: disable failing tests, enable test-std testingJacob Young
2023-10-21x86_64: fix bugs and disable erroring testsJacob Young
2023-07-21std.json: Unify stringify and writeStream (#16405)Josh Wolfe
2023-06-19std: Support user-provided jsonParse method. Unify json.Parser and ↵Josh Wolfe
json.parse* (#15705)
2023-05-13std: Rewrite low-level json api to support streaming (#15602)Josh Wolfe
2023-04-28update codebase to use `@memset` and `@memcpy`Andrew Kelley
2023-04-26std: @Vector support for std.json.parseJanne Hellsten
2023-03-21std.json: support tuplesMarcus Ramse
2023-02-18update std lib and compiler sources to new for loop syntaxAndrew Kelley
2023-02-04std.json: don't free struct default valuesJohn Schmidt
Closes https://github.com/ziglang/zig/issues/9509.
2023-02-04std.json: avoid dangling pointers in ValueTreeJohn Schmidt
Closes https://github.com/ziglang/zig/issues/5229.
2023-02-04std.json: fix parsing of structs with default value const pointersJohn Schmidt
2023-01-28std.json: check output and source lengths in `std.json`Jon-Eric Cook
2022-07-23std.json: Fix parsing of large numbersominitay
Numbers greater than about 2^53 are encoded as strings in JSON. std.json.parseInternal previously errored out in this condition.
2022-07-07std.json: move tests to json/test.zig fileAndrew Kelley
This accomplishes two things: * Works around #8442 by putting stage1-specific logic in to disable all the std.json tests. * Slightly reduces installation size of zig since std lib files ending in "test.zig" are excluded from being installed.
2021-08-24remove redundant license headers from zig standard libraryAndrew Kelley
We already have a LICENSE file that covers the Zig Standard Library. We no longer need to remind everyone that the license is MIT in every single file. Previously this was introduced to clarify the situation for a fork of Zig that made Zig's LICENSE file harder to find, and replaced it with their own license that required annual payments to their company. However that fork now appears to be dead. So there is no need to reinforce the copyright notice in every single file.
2021-05-13std/json: Fix premature closing brace being considered valid JSONMatthew Borkowski
return error from StreamingParser when reading closing brace when expecting value for an object key
2021-05-08std: update usage of std.testingVeikka Tuominen
2021-04-11std.meta: add isErrorxackus
2021-04-04Tidy-up in json test module (#8431)Lewis Gaul
* Switch json testing 'roundTrip()' to use FixedBufferStream, improve error handling, remove comptime from param * Add 'try' to calls to roundTrip() that can now return an error * Remove comptime from params in json testing, replace expect(false) with letting error propagate * Add 'try' to calls to ok() that can now return an error Co-authored-by: Lewis Gaul <legaul@cisco.com>
2021-04-04Switch std.json to use an ordered hashmapLewis Gaul
2020-12-31Year++Frank Denis
2020-12-08std.json: unreachable -> expect in testsxackus
2020-11-02std: Fix json utf{8,16} decoding on BE targetsLemonBoy
Byteswap some values when LE ordering is required.
2020-08-20add license header to all std lib filesAndrew Kelley
add SPDX license identifier copyright ownership is zig contributors
2020-04-24Add mips support to standard libraryTimon Kruiper
2020-03-29fix overflow in parseFloatxackus
2020-02-12Convert a lot of json tests to use testing.allocatorBenjamin Feng
2020-01-07json: disallow overlong and out-of-range UTF-8hryx
Fixes #2379 = Overlong (non-shortest) sequences UTF-8's unique encoding scheme allows for some Unicode codepoints to be represented in multiple ways. For any of these characters, the spec forbids all but the shortest form. These disallowed longer sequences are called "overlong". As an interesting side effect of this rule, the bytes C0 and C1 never appear in valid UTF-8. = Codepoint range UTF-8 disallows representation of codepoints beyond U+10FFFF, which is the highest character which can be encoded in UTF-16. Because a 4-byte sequence is capable of resulting in such characters, they must be explicitly rejected. This rule also has an interesting side effect, which is that bytes F5 to FF never appear. = References Detecting an overlong version of a codepoint could get gnarly, but luckily The Unicode Consortium did the hard work by creating this handy table of valid byte sequences: https://unicode.org/versions/corrigendum1.html I thought this mapped nicely to the parser's state machine, so I rearranged the relevant states to make use of it.
2020-01-06zig fmt and update `extern fn` to `callconv(.C)`Andrew Kelley
2019-11-11Stricter tests for non-streaming parserxackus
2019-11-11Fix bugs in JSON parserxackus
Make comments into documentation where appropriate
2019-11-11json: surrogate pair supportxackus
test json.Parser with tests used for json.Streaming parser (some don't pass yet)
2019-09-25mv std/ lib/Andrew Kelley
that's all this commit does. further commits will fix cli flags and such. see #2221