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

增加UTSJSONObject.toJSONString 测试示例

上级 243b16d6
...@@ -93,6 +93,21 @@ export function testUTSJSONObject() : Result { ...@@ -93,6 +93,21 @@ export function testUTSJSONObject() : Result {
expect(data5!.toJSONString()).toEqual('{"data4":{"data":{"num":1,"num2":2.369,"str":"test"},"name":"张三"}}') expect(data5!.toJSONString()).toEqual('{"data4":{"data":{"num":1,"num2":2.369,"str":"test"},"name":"张三"}}')
class TestData6 implements IJsonStringify{
toJSON():any|null{
return JSON.parse("22")
}
}
let testData6 = TestData6()
let data6 = {
data:testData6,
array:[1,"22",false],
name:"data6"
}
expect(data6!.toJSONString()).toEqual('{"data":22.0,"array":[1,"22",false],"name":"data6"}')
console.log(data6.toJSONString())
// #endif // #endif
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册