prettier/tests/json/__snapshots__/jsfmt.spec.js.snap

1576 lines
48 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`boolean.json 1`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
| printWidth
=====================================input======================================
true
=====================================output=====================================
true
================================================================================
`;
exports[`boolean.json 2`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
true
=====================================output=====================================
true
================================================================================
`;
exports[`boolean.json 3`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
| printWidth
=====================================input======================================
true
=====================================output=====================================
true
================================================================================
`;
exports[`boolean.json 4`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
true
=====================================output=====================================
true
================================================================================
`;
exports[`boolean.json 5`] = `
====================================options=====================================
parsers: ["json-stringify"]
printWidth: 80
| printWidth
=====================================input======================================
true
=====================================output=====================================
true
================================================================================
`;
exports[`key-value.json 1`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
| printWidth
=====================================input======================================
{
"string": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstring": "stringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring": "string"
}
=====================================output=====================================
{
"string": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstring": "stringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring": "string"
}
================================================================================
`;
exports[`key-value.json 2`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
{
"string": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstring": "stringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring": "string"
}
=====================================output=====================================
{
"string": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstring": "stringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring": "string"
}
================================================================================
`;
exports[`key-value.json 3`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
| printWidth
=====================================input======================================
{
"string": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstring": "stringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring": "string"
}
=====================================output=====================================
{
string: "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring",
stringstringstringstringstringstringstringstring: "stringstringstringstringstringstringstringstring",
stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring: "string"
}
================================================================================
`;
exports[`key-value.json 4`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
{
"string": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstring": "stringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring": "string"
}
=====================================output=====================================
{
string: "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring",
stringstringstringstringstringstringstringstring: "stringstringstringstringstringstringstringstring",
stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring: "string",
}
================================================================================
`;
exports[`key-value.json 5`] = `
====================================options=====================================
parsers: ["json-stringify"]
printWidth: 80
| printWidth
=====================================input======================================
{
"string": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstring": "stringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring": "string"
}
=====================================output=====================================
{
"string": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstring": "stringstringstringstringstringstringstringstring",
"stringstringstringstringstringstringstringstringstringstringstringstringstringstringstring": "string"
}
================================================================================
`;
exports[`multi-line.json 1`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
| printWidth
=====================================input======================================
{"key1":[true,false,null],"key2":{"key3":[1,2,"3",
1e10,1e-3]}}
=====================================output=====================================
{ "key1": [true, false, null], "key2": { "key3": [1, 2, "3", 1e10, 1e-3] } }
================================================================================
`;
exports[`multi-line.json 2`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
{"key1":[true,false,null],"key2":{"key3":[1,2,"3",
1e10,1e-3]}}
=====================================output=====================================
{ "key1": [true, false, null], "key2": { "key3": [1, 2, "3", 1e10, 1e-3] } }
================================================================================
`;
exports[`multi-line.json 3`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
| printWidth
=====================================input======================================
{"key1":[true,false,null],"key2":{"key3":[1,2,"3",
1e10,1e-3]}}
=====================================output=====================================
{ key1: [true, false, null], key2: { key3: [1, 2, "3", 1e10, 1e-3] } }
================================================================================
`;
exports[`multi-line.json 4`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
{"key1":[true,false,null],"key2":{"key3":[1,2,"3",
1e10,1e-3]}}
=====================================output=====================================
{ key1: [true, false, null], key2: { key3: [1, 2, "3", 1e10, 1e-3] } }
================================================================================
`;
exports[`multi-line.json 5`] = `
====================================options=====================================
parsers: ["json-stringify"]
printWidth: 80
| printWidth
=====================================input======================================
{"key1":[true,false,null],"key2":{"key3":[1,2,"3",
1e10,1e-3]}}
=====================================output=====================================
{
"key1": [
true,
false,
null
],
"key2": {
"key3": [
1,
2,
"3",
10000000000,
0.001
]
}
}
================================================================================
`;
exports[`null.json 1`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
| printWidth
=====================================input======================================
null
=====================================output=====================================
null
================================================================================
`;
exports[`null.json 2`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
null
=====================================output=====================================
null
================================================================================
`;
exports[`null.json 3`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
| printWidth
=====================================input======================================
null
=====================================output=====================================
null
================================================================================
`;
exports[`null.json 4`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
null
=====================================output=====================================
null
================================================================================
`;
exports[`null.json 5`] = `
====================================options=====================================
parsers: ["json-stringify"]
printWidth: 80
| printWidth
=====================================input======================================
null
=====================================output=====================================
null
================================================================================
`;
exports[`number.json 1`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
| printWidth
=====================================input======================================
0
=====================================output=====================================
0
================================================================================
`;
exports[`number.json 2`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
0
=====================================output=====================================
0
================================================================================
`;
exports[`number.json 3`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
| printWidth
=====================================input======================================
0
=====================================output=====================================
0
================================================================================
`;
exports[`number.json 4`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
0
=====================================output=====================================
0
================================================================================
`;
exports[`number.json 5`] = `
====================================options=====================================
parsers: ["json-stringify"]
printWidth: 80
| printWidth
=====================================input======================================
0
=====================================output=====================================
0
================================================================================
`;
exports[`pass1.json 1`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
| printWidth
=====================================input======================================
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -9876.543210,
"e": 0.123456789e-12,
"E": 1.234567890E+34,
"": 23456789012E66,
"zero": 0,
"one": 1,
"space": " ",
"quote": "\\"",
"backslash": "\\\\",
"controls": "\\b\\f\\n\\r\\t",
"slash": "/ & \\/",
"alpha": "abcdefghijklmnopqrstuvwyz",
"ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
"digit": "0123456789",
"0123456789": "digit",
"special": "\`1~!@#$%^&*()_+-={':[,]}|;.</>?",
"hex": "\\u0123\\u4567\\u89AB\\uCDEF\\uabcd\\uef4A",
"true": true,
"false": false,
"null": null,
"array":[ ],
"object":{ },
"address": "50 St. James Street",
"url": "http://www.JSON.org/",
"comment": "// /* <!-- --",
"# -- --> */": " ",
" s p a c e d " :[1,2 , 3
,
4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7],
"jsontext": "{\\"object with 1 member\\":[\\"array with 1 element\\"]}",
"quotes": "&#34; \\u0022 %22 0x22 034 &#x22;",
"\\/\\\\\\"\\uCAFE\\uBABE\\uAB98\\uFCDE\\ubcda\\uef4A\\b\\f\\n\\r\\t\`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
: "A key can be any string"
},
0.5 ,98.6
,
99.44
,
1066,
1e1,
0.1e1,
1e-1,
1e00,2e+00,2e-00
,"rosebud"]
=====================================output=====================================
[
"JSON Test Pattern pass1",
{ "object with 1 member": ["array with 1 element"] },
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -9876.54321,
"e": 0.123456789e-12,
"E": 1.23456789e34,
"": 23456789012e66,
"zero": 0,
"one": 1,
"space": " ",
"quote": "\\"",
"backslash": "\\\\",
"controls": "\\b\\f\\n\\r\\t",
"slash": "/ & /",
"alpha": "abcdefghijklmnopqrstuvwyz",
"ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
"digit": "0123456789",
"0123456789": "digit",
"special": "\`1~!@#$%^&*()_+-={':[,]}|;.</>?",
"hex": "\\u0123\\u4567\\u89AB\\uCDEF\\uabcd\\uef4A",
"true": true,
"false": false,
"null": null,
"array": [],
"object": {},
"address": "50 St. James Street",
"url": "http://www.JSON.org/",
"comment": "// /* <!-- --",
"# -- --> */": " ",
" s p a c e d ": [1, 2, 3, 4, 5, 6, 7],
"compact": [1, 2, 3, 4, 5, 6, 7],
"jsontext": "{\\"object with 1 member\\":[\\"array with 1 element\\"]}",
"quotes": "&#34; \\u0022 %22 0x22 034 &#x22;",
"/\\\\\\"\\uCAFE\\uBABE\\uAB98\\uFCDE\\ubcda\\uef4A\\b\\f\\n\\r\\t\`1~!@#$%^&*()_+-=[]{}|;:',./<>?": "A key can be any string"
},
0.5,
98.6,
99.44,
1066,
1e1,
0.1e1,
1e-1,
1,
2,
2,
"rosebud"
]
================================================================================
`;
exports[`pass1.json 2`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -9876.543210,
"e": 0.123456789e-12,
"E": 1.234567890E+34,
"": 23456789012E66,
"zero": 0,
"one": 1,
"space": " ",
"quote": "\\"",
"backslash": "\\\\",
"controls": "\\b\\f\\n\\r\\t",
"slash": "/ & \\/",
"alpha": "abcdefghijklmnopqrstuvwyz",
"ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
"digit": "0123456789",
"0123456789": "digit",
"special": "\`1~!@#$%^&*()_+-={':[,]}|;.</>?",
"hex": "\\u0123\\u4567\\u89AB\\uCDEF\\uabcd\\uef4A",
"true": true,
"false": false,
"null": null,
"array":[ ],
"object":{ },
"address": "50 St. James Street",
"url": "http://www.JSON.org/",
"comment": "// /* <!-- --",
"# -- --> */": " ",
" s p a c e d " :[1,2 , 3
,
4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7],
"jsontext": "{\\"object with 1 member\\":[\\"array with 1 element\\"]}",
"quotes": "&#34; \\u0022 %22 0x22 034 &#x22;",
"\\/\\\\\\"\\uCAFE\\uBABE\\uAB98\\uFCDE\\ubcda\\uef4A\\b\\f\\n\\r\\t\`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
: "A key can be any string"
},
0.5 ,98.6
,
99.44
,
1066,
1e1,
0.1e1,
1e-1,
1e00,2e+00,2e-00
,"rosebud"]
=====================================output=====================================
[
"JSON Test Pattern pass1",
{ "object with 1 member": ["array with 1 element"] },
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -9876.54321,
"e": 0.123456789e-12,
"E": 1.23456789e34,
"": 23456789012e66,
"zero": 0,
"one": 1,
"space": " ",
"quote": "\\"",
"backslash": "\\\\",
"controls": "\\b\\f\\n\\r\\t",
"slash": "/ & /",
"alpha": "abcdefghijklmnopqrstuvwyz",
"ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
"digit": "0123456789",
"0123456789": "digit",
"special": "\`1~!@#$%^&*()_+-={':[,]}|;.</>?",
"hex": "\\u0123\\u4567\\u89AB\\uCDEF\\uabcd\\uef4A",
"true": true,
"false": false,
"null": null,
"array": [],
"object": {},
"address": "50 St. James Street",
"url": "http://www.JSON.org/",
"comment": "// /* <!-- --",
"# -- --> */": " ",
" s p a c e d ": [1, 2, 3, 4, 5, 6, 7],
"compact": [1, 2, 3, 4, 5, 6, 7],
"jsontext": "{\\"object with 1 member\\":[\\"array with 1 element\\"]}",
"quotes": "&#34; \\u0022 %22 0x22 034 &#x22;",
"/\\\\\\"\\uCAFE\\uBABE\\uAB98\\uFCDE\\ubcda\\uef4A\\b\\f\\n\\r\\t\`1~!@#$%^&*()_+-=[]{}|;:',./<>?": "A key can be any string"
},
0.5,
98.6,
99.44,
1066,
1e1,
0.1e1,
1e-1,
1,
2,
2,
"rosebud"
]
================================================================================
`;
exports[`pass1.json 3`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
| printWidth
=====================================input======================================
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -9876.543210,
"e": 0.123456789e-12,
"E": 1.234567890E+34,
"": 23456789012E66,
"zero": 0,
"one": 1,
"space": " ",
"quote": "\\"",
"backslash": "\\\\",
"controls": "\\b\\f\\n\\r\\t",
"slash": "/ & \\/",
"alpha": "abcdefghijklmnopqrstuvwyz",
"ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
"digit": "0123456789",
"0123456789": "digit",
"special": "\`1~!@#$%^&*()_+-={':[,]}|;.</>?",
"hex": "\\u0123\\u4567\\u89AB\\uCDEF\\uabcd\\uef4A",
"true": true,
"false": false,
"null": null,
"array":[ ],
"object":{ },
"address": "50 St. James Street",
"url": "http://www.JSON.org/",
"comment": "// /* <!-- --",
"# -- --> */": " ",
" s p a c e d " :[1,2 , 3
,
4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7],
"jsontext": "{\\"object with 1 member\\":[\\"array with 1 element\\"]}",
"quotes": "&#34; \\u0022 %22 0x22 034 &#x22;",
"\\/\\\\\\"\\uCAFE\\uBABE\\uAB98\\uFCDE\\ubcda\\uef4A\\b\\f\\n\\r\\t\`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
: "A key can be any string"
},
0.5 ,98.6
,
99.44
,
1066,
1e1,
0.1e1,
1e-1,
1e00,2e+00,2e-00
,"rosebud"]
=====================================output=====================================
[
"JSON Test Pattern pass1",
{ "object with 1 member": ["array with 1 element"] },
{},
[],
-42,
true,
false,
null,
{
integer: 1234567890,
real: -9876.54321,
e: 0.123456789e-12,
E: 1.23456789e34,
"": 23456789012e66,
zero: 0,
one: 1,
space: " ",
quote: '"',
backslash: "\\\\",
controls: "\\b\\f\\n\\r\\t",
slash: "/ & /",
alpha: "abcdefghijklmnopqrstuvwyz",
ALPHA: "ABCDEFGHIJKLMNOPQRSTUVWYZ",
digit: "0123456789",
"0123456789": "digit",
special: "\`1~!@#$%^&*()_+-={':[,]}|;.</>?",
hex: "\\u0123\\u4567\\u89AB\\uCDEF\\uabcd\\uef4A",
true: true,
false: false,
null: null,
array: [],
object: {},
address: "50 St. James Street",
url: "http://www.JSON.org/",
comment: "// /* <!-- --",
"# -- --> */": " ",
" s p a c e d ": [1, 2, 3, 4, 5, 6, 7],
compact: [1, 2, 3, 4, 5, 6, 7],
jsontext: '{"object with 1 member":["array with 1 element"]}',
quotes: "&#34; \\u0022 %22 0x22 034 &#x22;",
"/\\\\\\"\\uCAFE\\uBABE\\uAB98\\uFCDE\\ubcda\\uef4A\\b\\f\\n\\r\\t\`1~!@#$%^&*()_+-=[]{}|;:',./<>?": "A key can be any string"
},
0.5,
98.6,
99.44,
1066,
1e1,
0.1e1,
1e-1,
1,
2,
2,
"rosebud"
]
================================================================================
`;
exports[`pass1.json 4`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -9876.543210,
"e": 0.123456789e-12,
"E": 1.234567890E+34,
"": 23456789012E66,
"zero": 0,
"one": 1,
"space": " ",
"quote": "\\"",
"backslash": "\\\\",
"controls": "\\b\\f\\n\\r\\t",
"slash": "/ & \\/",
"alpha": "abcdefghijklmnopqrstuvwyz",
"ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
"digit": "0123456789",
"0123456789": "digit",
"special": "\`1~!@#$%^&*()_+-={':[,]}|;.</>?",
"hex": "\\u0123\\u4567\\u89AB\\uCDEF\\uabcd\\uef4A",
"true": true,
"false": false,
"null": null,
"array":[ ],
"object":{ },
"address": "50 St. James Street",
"url": "http://www.JSON.org/",
"comment": "// /* <!-- --",
"# -- --> */": " ",
" s p a c e d " :[1,2 , 3
,
4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7],
"jsontext": "{\\"object with 1 member\\":[\\"array with 1 element\\"]}",
"quotes": "&#34; \\u0022 %22 0x22 034 &#x22;",
"\\/\\\\\\"\\uCAFE\\uBABE\\uAB98\\uFCDE\\ubcda\\uef4A\\b\\f\\n\\r\\t\`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
: "A key can be any string"
},
0.5 ,98.6
,
99.44
,
1066,
1e1,
0.1e1,
1e-1,
1e00,2e+00,2e-00
,"rosebud"]
=====================================output=====================================
[
"JSON Test Pattern pass1",
{ "object with 1 member": ["array with 1 element"] },
{},
[],
-42,
true,
false,
null,
{
integer: 1234567890,
real: -9876.54321,
e: 0.123456789e-12,
E: 1.23456789e34,
"": 23456789012e66,
zero: 0,
one: 1,
space: " ",
quote: '"',
backslash: "\\\\",
controls: "\\b\\f\\n\\r\\t",
slash: "/ & /",
alpha: "abcdefghijklmnopqrstuvwyz",
ALPHA: "ABCDEFGHIJKLMNOPQRSTUVWYZ",
digit: "0123456789",
"0123456789": "digit",
special: "\`1~!@#$%^&*()_+-={':[,]}|;.</>?",
hex: "\\u0123\\u4567\\u89AB\\uCDEF\\uabcd\\uef4A",
true: true,
false: false,
null: null,
array: [],
object: {},
address: "50 St. James Street",
url: "http://www.JSON.org/",
comment: "// /* <!-- --",
"# -- --> */": " ",
" s p a c e d ": [1, 2, 3, 4, 5, 6, 7],
compact: [1, 2, 3, 4, 5, 6, 7],
jsontext: '{"object with 1 member":["array with 1 element"]}',
quotes: "&#34; \\u0022 %22 0x22 034 &#x22;",
"/\\\\\\"\\uCAFE\\uBABE\\uAB98\\uFCDE\\ubcda\\uef4A\\b\\f\\n\\r\\t\`1~!@#$%^&*()_+-=[]{}|;:',./<>?": "A key can be any string",
},
0.5,
98.6,
99.44,
1066,
1e1,
0.1e1,
1e-1,
1,
2,
2,
"rosebud",
]
================================================================================
`;
exports[`pass1.json 5`] = `
====================================options=====================================
parsers: ["json-stringify"]
printWidth: 80
| printWidth
=====================================input======================================
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -9876.543210,
"e": 0.123456789e-12,
"E": 1.234567890E+34,
"": 23456789012E66,
"zero": 0,
"one": 1,
"space": " ",
"quote": "\\"",
"backslash": "\\\\",
"controls": "\\b\\f\\n\\r\\t",
"slash": "/ & \\/",
"alpha": "abcdefghijklmnopqrstuvwyz",
"ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
"digit": "0123456789",
"0123456789": "digit",
"special": "\`1~!@#$%^&*()_+-={':[,]}|;.</>?",
"hex": "\\u0123\\u4567\\u89AB\\uCDEF\\uabcd\\uef4A",
"true": true,
"false": false,
"null": null,
"array":[ ],
"object":{ },
"address": "50 St. James Street",
"url": "http://www.JSON.org/",
"comment": "// /* <!-- --",
"# -- --> */": " ",
" s p a c e d " :[1,2 , 3
,
4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7],
"jsontext": "{\\"object with 1 member\\":[\\"array with 1 element\\"]}",
"quotes": "&#34; \\u0022 %22 0x22 034 &#x22;",
"\\/\\\\\\"\\uCAFE\\uBABE\\uAB98\\uFCDE\\ubcda\\uef4A\\b\\f\\n\\r\\t\`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
: "A key can be any string"
},
0.5 ,98.6
,
99.44
,
1066,
1e1,
0.1e1,
1e-1,
1e00,2e+00,2e-00
,"rosebud"]
=====================================output=====================================
[
"JSON Test Pattern pass1",
{
"object with 1 member": [
"array with 1 element"
]
},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -9876.54321,
"e": 1.23456789e-13,
"E": 1.23456789e+34,
"": 2.3456789012e+76,
"zero": 0,
"one": 1,
"space": " ",
"quote": "\\"",
"backslash": "\\\\",
"controls": "\\b\\f\\n\\r\\t",
"slash": "/ & /",
"alpha": "abcdefghijklmnopqrstuvwyz",
"ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
"digit": "0123456789",
"0123456789": "digit",
"special": "\`1~!@#$%^&*()_+-={':[,]}|;.</>?",
"hex": "ģ䕧覫췯ꯍ",
"true": true,
"false": false,
"null": null,
"array": [],
"object": {},
"address": "50 St. James Street",
"url": "http://www.JSON.org/",
"comment": "// /* <!-- --",
"# -- --> */": " ",
" s p a c e d ": [
1,
2,
3,
4,
5,
6,
7
],
"compact": [
1,
2,
3,
4,
5,
6,
7
],
"jsontext": "{\\"object with 1 member\\":[\\"array with 1 element\\"]}",
"quotes": "&#34; \\" %22 0x22 034 &#x22;",
"/\\\\\\"쫾몾ꮘﳞ볚\\b\\f\\n\\r\\t\`1~!@#$%^&*()_+-=[]{}|;:',./<>?": "A key can be any string"
},
0.5,
98.6,
99.44,
1066,
10,
1,
0.1,
1,
2,
2,
"rosebud"
]
================================================================================
`;
exports[`positive-number.json 1`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
| printWidth
=====================================input======================================
+123
=====================================output=====================================
+123
================================================================================
`;
exports[`positive-number.json 2`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
+123
=====================================output=====================================
+123
================================================================================
`;
exports[`positive-number.json 3`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
| printWidth
=====================================input======================================
+123
=====================================output=====================================
+123
================================================================================
`;
exports[`positive-number.json 4`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
+123
=====================================output=====================================
+123
================================================================================
`;
exports[`positive-number.json 5`] = `
====================================options=====================================
parsers: ["json-stringify"]
printWidth: 80
| printWidth
=====================================input======================================
+123
=====================================output=====================================
123
================================================================================
`;
exports[`propertyKey.json 1`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
| printWidth
=====================================input======================================
{
a: 123
}
=====================================output=====================================
{
"a": 123
}
================================================================================
`;
exports[`propertyKey.json 2`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
{
a: 123
}
=====================================output=====================================
{
"a": 123
}
================================================================================
`;
exports[`propertyKey.json 3`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
| printWidth
=====================================input======================================
{
a: 123
}
=====================================output=====================================
{
a: 123
}
================================================================================
`;
exports[`propertyKey.json 4`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
{
a: 123
}
=====================================output=====================================
{
a: 123,
}
================================================================================
`;
exports[`propertyKey.json 5`] = `
====================================options=====================================
parsers: ["json-stringify"]
printWidth: 80
| printWidth
=====================================input======================================
{
a: 123
}
=====================================output=====================================
{
"a": 123
}
================================================================================
`;
exports[`single-line.json 1`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
| printWidth
=====================================input======================================
{"key1":[true,false,null],"key2":{"key3":[1,2,"3",1e10,1e-3]}}
=====================================output=====================================
{ "key1": [true, false, null], "key2": { "key3": [1, 2, "3", 1e10, 1e-3] } }
================================================================================
`;
exports[`single-line.json 2`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
{"key1":[true,false,null],"key2":{"key3":[1,2,"3",1e10,1e-3]}}
=====================================output=====================================
{ "key1": [true, false, null], "key2": { "key3": [1, 2, "3", 1e10, 1e-3] } }
================================================================================
`;
exports[`single-line.json 3`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
| printWidth
=====================================input======================================
{"key1":[true,false,null],"key2":{"key3":[1,2,"3",1e10,1e-3]}}
=====================================output=====================================
{ key1: [true, false, null], key2: { key3: [1, 2, "3", 1e10, 1e-3] } }
================================================================================
`;
exports[`single-line.json 4`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
{"key1":[true,false,null],"key2":{"key3":[1,2,"3",1e10,1e-3]}}
=====================================output=====================================
{ key1: [true, false, null], key2: { key3: [1, 2, "3", 1e10, 1e-3] } }
================================================================================
`;
exports[`single-line.json 5`] = `
====================================options=====================================
parsers: ["json-stringify"]
printWidth: 80
| printWidth
=====================================input======================================
{"key1":[true,false,null],"key2":{"key3":[1,2,"3",1e10,1e-3]}}
=====================================output=====================================
{
"key1": [
true,
false,
null
],
"key2": {
"key3": [
1,
2,
"3",
10000000000,
0.001
]
}
}
================================================================================
`;
exports[`single-quote.json 1`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
| printWidth
=====================================input======================================
'hello'
=====================================output=====================================
"hello"
================================================================================
`;
exports[`single-quote.json 2`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
'hello'
=====================================output=====================================
"hello"
================================================================================
`;
exports[`single-quote.json 3`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
| printWidth
=====================================input======================================
'hello'
=====================================output=====================================
"hello"
================================================================================
`;
exports[`single-quote.json 4`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
'hello'
=====================================output=====================================
"hello"
================================================================================
`;
exports[`single-quote.json 5`] = `
====================================options=====================================
parsers: ["json-stringify"]
printWidth: 80
| printWidth
=====================================input======================================
'hello'
=====================================output=====================================
"hello"
================================================================================
`;
exports[`string.json 1`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
| printWidth
=====================================input======================================
"string"
=====================================output=====================================
"string"
================================================================================
`;
exports[`string.json 2`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
"string"
=====================================output=====================================
"string"
================================================================================
`;
exports[`string.json 3`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
| printWidth
=====================================input======================================
"string"
=====================================output=====================================
"string"
================================================================================
`;
exports[`string.json 4`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
"string"
=====================================output=====================================
"string"
================================================================================
`;
exports[`string.json 5`] = `
====================================options=====================================
parsers: ["json-stringify"]
printWidth: 80
| printWidth
=====================================input======================================
"string"
=====================================output=====================================
"string"
================================================================================
`;
exports[`trailingComma.notjson 1`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
| printWidth
=====================================input======================================
{
"k1": "v1",
"k2": "v2",
"k3": "v3"
}
=====================================output=====================================
{
"k1": "v1",
"k2": "v2",
"k3": "v3"
}
================================================================================
`;
exports[`trailingComma.notjson 2`] = `
====================================options=====================================
parsers: ["json"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
{
"k1": "v1",
"k2": "v2",
"k3": "v3"
}
=====================================output=====================================
{
"k1": "v1",
"k2": "v2",
"k3": "v3"
}
================================================================================
`;
exports[`trailingComma.notjson 3`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
| printWidth
=====================================input======================================
{
"k1": "v1",
"k2": "v2",
"k3": "v3"
}
=====================================output=====================================
{
k1: "v1",
k2: "v2",
k3: "v3"
}
================================================================================
`;
exports[`trailingComma.notjson 4`] = `
====================================options=====================================
parsers: ["json5"]
printWidth: 80
trailingComma: "all"
| printWidth
=====================================input======================================
{
"k1": "v1",
"k2": "v2",
"k3": "v3"
}
=====================================output=====================================
{
k1: "v1",
k2: "v2",
k3: "v3",
}
================================================================================
`;
exports[`trailingComma.notjson 5`] = `
====================================options=====================================
parsers: ["json-stringify"]
printWidth: 80
| printWidth
=====================================input======================================
{
"k1": "v1",
"k2": "v2",
"k3": "v3"
}
=====================================output=====================================
{
"k1": "v1",
"k2": "v2",
"k3": "v3"
}
================================================================================
`;