mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-01 07:52:50 +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
Notes:
sideshowbarker
2024-07-17 20:37:18 +09:00
Author: https://github.com/ForLoveOfCats
Commit: 71ab8fb757
Pull-request: https://github.com/SerenityOS/serenity/pull/12004
Reviewed-by: https://github.com/linusg ✅
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