54 lines
1.0 KiB
Plaintext
54 lines
1.0 KiB
Plaintext
Test JSON formatting.
|
|
|
|
|
|
== Running test suite: JSFormatter.JSON
|
|
-- Running test case: JSFormatter.ValidJSON
|
|
JSON: "{\"a\":123,\"b\":[1,2,3],\"c\":{\"d\":\"e\"}}"
|
|
PASS: JSON should be valid.
|
|
FORMATTED:
|
|
{
|
|
"a": 123,
|
|
"b": [
|
|
1,
|
|
2,
|
|
3
|
|
],
|
|
"c": {
|
|
"d": "e"
|
|
}
|
|
}
|
|
|
|
-- Running test case: JSFormatter.InvalidButObject
|
|
JSON: "{a:123,b:[1,2,3],c:{d:\"e\"}}"
|
|
PASS: JSON should be invalid.
|
|
PASS: Should be able to be evaluated to an object.
|
|
FORMATTED:
|
|
{
|
|
a: 123,
|
|
b: [1, 2, 3],
|
|
c: {
|
|
d: "e"
|
|
}
|
|
}
|
|
|
|
-- Running test case: JSFormatter.InvalidWithComments
|
|
JSON: "{\"a\":123,\"b\":[1,2,3],\"c\":{\"d\":\"e\"}}/*Comment*/"
|
|
PASS: JSON should be invalid.
|
|
PASS: Should be able to be evaluated to an object.
|
|
FORMATTED:
|
|
{
|
|
"a": 123,
|
|
"b": [1, 2, 3],
|
|
"c": {
|
|
"d": "e"
|
|
}
|
|
} /*Comment*/
|
|
|
|
|
|
-- Running test case: JSFormatter.Invalid
|
|
INPUT: "{a:1 b:2}"
|
|
PASS: JSON should be invalid.
|
|
PASS: Should not be able to be evaluated to an object.
|
|
PASS: Response should be null.
|
|
|