mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-16 16:12:53 +00:00
Libraries: Move to Userland/Libraries/
This commit is contained in:
parent
dc28c07fa5
commit
13d7c09125
Notes:
sideshowbarker
2024-07-18 23:53:55 +09:00
Author: https://github.com/awesomekling
Commit: 13d7c09125
1857 changed files with 266 additions and 274 deletions
|
@ -1,37 +0,0 @@
|
|||
test("basic functionality", () => {
|
||||
expect(JSON.parse).toHaveLength(2);
|
||||
|
||||
const properties = [
|
||||
["5", 5],
|
||||
["null", null],
|
||||
["true", true],
|
||||
["false", false],
|
||||
['"test"', "test"],
|
||||
['[1,2,"foo"]', [1, 2, "foo"]],
|
||||
['{"foo":1,"bar":"baz"}', { foo: 1, bar: "baz" }],
|
||||
];
|
||||
|
||||
properties.forEach(testCase => {
|
||||
expect(JSON.parse(testCase[0])).toEqual(testCase[1]);
|
||||
});
|
||||
});
|
||||
|
||||
test("syntax errors", () => {
|
||||
[
|
||||
undefined,
|
||||
NaN,
|
||||
-NaN,
|
||||
Infinity,
|
||||
-Infinity,
|
||||
'{ "foo" }',
|
||||
'{ foo: "bar" }',
|
||||
"[1,2,3,]",
|
||||
"[1,2,3, ]",
|
||||
'{ "foo": "bar",}',
|
||||
'{ "foo": "bar", }',
|
||||
].forEach(test => {
|
||||
expect(() => {
|
||||
JSON.parse(test);
|
||||
}).toThrow(SyntaxError);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue