mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:08:12 +00:00
LibJS: Add in-tree test for Json parsing of negative zeros
This mirrors the cases in `built-ins/JSON/parse/text-negative-zero` in test262
This commit is contained in:
parent
1d95fd5443
commit
71ab8fb757
1 changed files with 8 additions and 0 deletions
|
@ -35,3 +35,11 @@ test("syntax errors", () => {
|
|||
}).toThrow(SyntaxError);
|
||||
});
|
||||
});
|
||||
|
||||
test("negative zero", () => {
|
||||
["-0", " \n-0", "-0 \t", "\n\t -0\n ", "-0.0"].forEach(testCase => {
|
||||
expect(JSON.parse(testCase)).toEqual(-0.0);
|
||||
});
|
||||
|
||||
expect(JSON.parse(-0)).toEqual(0);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue