提交 5d65e91f 编写于 作者: 杜庆泉's avatar 杜庆泉

增加UTSJSONObject.assign 示例

上级 a96be066
...@@ -22,7 +22,19 @@ export function testUTSJSONObject() : Result { ...@@ -22,7 +22,19 @@ export function testUTSJSONObject() : Result {
const returnedTarget = UTSJSONObject.assign(target, source); const returnedTarget = UTSJSONObject.assign(target, source);
expect(returnedTarget.toMap().size).toEqual(3); expect(returnedTarget.toMap().size).toEqual(3);
console.log(returnedTarget)
type A = {
username:"张三",
age:12
}
type C = {
work:0.001
}
let b = UTSJSONObject.assign(new A("张三",12),{b:2},new C(0.002))
expect(b['age']).toEqual(12);
expect(b['username']).toEqual("张三");
expect(b['b']).toEqual(2);
expect(b['work']).toEqual(0.002);
// #endif // #endif
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册