提交 dd3e0167 编写于 作者: lizhongyi_'s avatar lizhongyi_

调整部分测试例

上级 9ec11da2
......@@ -38,9 +38,9 @@ function countOccurrences(str : string, substr : string) : number {
return count;
}
// #ifdef APP-ANDROID
class A1 implements IJSONStringify{
override toJSON():any|null{
toJSON():any|null{
let jsonRet = {
'name': "zhangsan",
'age': 12,
......@@ -78,20 +78,20 @@ class A6 implements IJSONStringify{
return new A5()
}
}
// #endif
export function testJSON() : Result {
return describe("JSON", () => {
test('custom-stringify', () => {
// #ifdef APP-ANDROID
expect(JSON.stringify(new A1()).length).toEqual(28)
expect(JSON.stringify(new A1())!.length).toEqual(28)
expect(JSON.stringify(new A2())).toEqual("2")
expect(JSON.stringify(new A3())).toEqual('"json"')
expect(JSON.stringify(new A4())).toEqual('null')
expect(JSON.stringify(new A5()).length).toEqual(28)
expect(JSON.stringify(new A6()).length).toEqual(28)
// #endif
expect(JSON.stringify(new A5())!.length).toEqual(28)
expect(JSON.stringify(new A6())!.length).toEqual(28)
})
test('parse', () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册