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

调整部分测试例

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