Files
cocos-engine/tests/core/serialization/shared/cases/primitives.test.ts
Leslie Leigh (李的序) 705c977fc9 Binary serialization (#8946)
* Binary serialization

* Update snapshots

* Update

* rename option ccon -> useCCON

* Missing script

* encodeCCONJson: chunks -> chunkURLs

* Update

* (de)serializeSymbol -> (de)serializeTag;

* CustomizedSerializable -> CustomSerializable

* _deserializePrimitiveObject -> _fillPlainObject

* Unify CCClass CCClassConstructor

* encodeCCONJson -> parseCCONJson

* Custom serializable

* Move (de)serializeSuper(This) from context into global

* property -> read(write)Property; (de)serializeThis(Super) -> (read)writeThis(Super)

* CI and lint

* Mock cc env
2021-07-15 10:21:25 +08:00

38 lines
631 B
TypeScript

import { PORTS_BOTH_DYNAMIC_COMPILED, testEachPort } from "../port";
import { runTest } from "../utils";
const value = [
// Floats
0.0,
1.0,
3.1415926,
-0.618,
Number.MIN_VALUE,
Number.MAX_VALUE,
// Infinities and NaN can bot be serialized as JSON
// -Infinity,
// Infinity,
// NaN,
// Booleans
true,
false,
// Integers
0,
1,
Number.MIN_SAFE_INTEGER,
Number.MAX_SAFE_INTEGER,
// Strings
'blah blah',
];
testEachPort(PORTS_BOTH_DYNAMIC_COMPILED, async (port) => {
await runTest(
__filename,
port,
value,
);
});