aboutsummaryrefslogtreecommitdiff
path: root/lib/std/json/test.zig
AgeCommit message (Collapse)Author
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