提交 69a95cc4 编写于 作者: 杜庆泉's avatar 杜庆泉

补充UTSJSONObject set-after-get 测试示例

上级 7415b7db
......@@ -26,6 +26,23 @@ export function testUTSJSONObject() : Result {
// #endif
})
test('setvalue-after-get', () => {
let obj = {
"cars":[
{
name:"car1",
value:100
}
]
}
let cars = obj.getArray<UTSJSONObject>("cars")
cars![0].set("value",20)
let firstCar = obj.getJSON("cars[0]")
expect(firstCar!['value']).toEqual(20);
})
test('assign-withtype', () => {
// #ifdef APP-ANDROID
type User = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册