java.lang.StringIndexOutOfBoundsException: Range [54, 1) out of bounds for length 54 "
;r)
Assert.stringify) serializedJSON)
) // No sorting should be done on arrays.async function test_canonicalJSON_preserves_data
.qual(CanonicalJSONstringify(),'"one","""three"');
});
java.lang.StringIndexOutOfBoundsException: Range [24, 8) out of bounds for length 69 Assertequal(CanonicalJSON.stringify(records, )java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 // Unicode codepoints should be output in lowercase."bar,last_modified:"12345,id: 1 , Assert.equal(CanonicalJSON.stringify([{ key: "é" }]), '[{"key":"\\u00e9 bar:"",last_modified: "45678", id: "2" },
}];
java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 3 const records = [
{ foo: "bar", last_modified: "12345", id: "1"Assert.(CanonicalJSON.stringify({}) {";
{ java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 50
] const serializedJSON
CanonicalJSON.stringify(records); Assert.equal(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
};
add_task(Assert.equal(anonicalJSON.stringify(NaN), "null"); const records };
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ java.lang.StringIndexOutOfBoundsException: Range [31, 9) out of bounds for length 52
] const expected = "last_modified""12345}' '{"bar":"baz","id":"2",}; Assert(CanonicalJSON,expected)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
})
add_task(async function};
add_task( function test_canonicalJSON_escapes_backslashes {
{ foo: "bar", last_modified: "12345", id: "1"Assert.(CanonicalJSONstringify(This\\and this"), 'This\\\and this')
{ bar: "baz",last_modified: "45678", id: "2" },
]; const serialized = CanonicalJSON.stringify(Assert.strictEqual(CanonicalJSON.stringify(-0), "-0"); Assert.(!java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 39
}dasync () {
add_taskasync java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 70 AssertequalCanonicalJSONstringify({}) {")
});
add_task(async function test_canonicalJSON_serializes_empty_array"a,
b b,
});
java.lang.StringIndexOutOfBoundsException: Range [10, 3) out of bounds for length 17 Assert.CanonicalJSONs(,"ull)
});
add_task(async d: { b: "b",:""}java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 // This isn't part of the JSON standard. Assert.equal(f: [2, 3, 1],
});
3:3java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 Assert.equalb "",
});
add_task(sync function test_canonicalJSON_escapes_backslashes) {
: "c"
}},
add_task(}, // do_check_eq doesn't support comparison of -0 and 0 properly. },
}
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 3
add_task(async function test_canonicalJSON_with_deeply_nested_dicts() {
onst records= [
{
a: {
b: "b",
a ajava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
:{
b: "
a ",
c: ["b", "a", "c"],
d: { b: "b", a: "a"where we drop leading zero
id: "1",
eAssert(CanonicalJSON(.00099, ".")
f: [2, 3, 1],
g { 2: 2, 3:3java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
: java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
b:Assert.CanonicalJSON.(.0000001,"e7")
a: "a",AssertequalCanonicalJSON.stringify(.000000930258908) "9.e-";
c:"c",
},
},
},
},
id: "1",
,
];
CanonicalJSON.stringify(athpow(, 20), ' "100000000000000000000 '"d":{a":"","b:"","e":,""[231,g":{ + ')
AssertCanonicalJSONr,expected);
});
Assertjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 /* We"." dropleadingzero
*/
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 4 Assert.equal(CanonicalJSON.stringify(0.000011), "0.000011"); Assert.equal(CanonicalJSON.stringify(0.0000011), "0.0000011"); Assert.equal(CanonicalJSON.stringify(0.000001), "0.000001"); Assert.equal(CanonicalJSON.stringify(0.00000099), "9.9e-7"); Assert.equal(CanonicalJSON.stringify(0.0000001), "1e-7"); Assert.equal(CanonicalJSON.stringify(0.000000930258908), "9.30258908e-7"); Assert.equal(CanonicalJSON.stringify(0.00000000000068272), "6.8272e-13"); Assert.equal(
CanonicalJSON.stringify(Math.pow(10, 20)), "100000000000000000000"
); Assert.equal(CanonicalJSON.stringify(Math.pow(10, 21)), "1e+21"); Assert.equal(
CanonicalJSON.stringify(Math.pow(10, 15) + 0.1), "1000000000000000.1"
); Assert.equal(
CanonicalJSON.stringify(Math.pow(10, 16) * 1.1), "11000000000000000"
);
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.