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

给部分测试例加条件编译,避免iOS编译报错

(cherry picked from commit 7871091d)
上级 01874ff1
...@@ -655,8 +655,9 @@ export function testArray() : Result { ...@@ -655,8 +655,9 @@ export function testArray() : Result {
console.log(Array.isArray(new Array(5))); console.log(Array.isArray(new Array(5)));
// Expected output: true // Expected output: true
// #ifdef APP-ANDROID
console.log(Array.isArray(new Int16Array([15, 33]))); console.log(Array.isArray(new Int16Array([15, 33])));
// #endif
// Expected output: false // Expected output: false
// #END // #END
}) })
...@@ -676,7 +677,7 @@ export function testArray() : Result { ...@@ -676,7 +677,7 @@ export function testArray() : Result {
// #END // #END
// #TEST Array.sampleForEach // #TEST Array.sampleForEach
fruits.forEach(function (item, index, array) { fruits.forEach(function (item, index: number, array) {
console.log(item, index) console.log(item, index)
}) })
// Apple 0 // Apple 0
...@@ -779,7 +780,10 @@ export function testArray() : Result { ...@@ -779,7 +780,10 @@ export function testArray() : Result {
// #END // #END
// #TEST Array.sampleFillError // #TEST Array.sampleFillError
// #ifdef APP-ANDROID
new Array(20).fill(0) new Array(20).fill(0)
// #endif
// #END // #END
}) })
......
...@@ -277,7 +277,9 @@ export function testNumber() : Result { ...@@ -277,7 +277,9 @@ export function testNumber() : Result {
// #ifdef APP // #ifdef APP
// #TEST Number.toByte // #TEST Number.toByte
let a = 12 let a = 12
// #ifdef APP-ANDROID
console.log(a.toByte()); console.log(a.toByte());
// #endif
// expected output: 12 // expected output: 12
// #END // #END
expect(a.toInt()).toEqual(12); expect(a.toInt()).toEqual(12);
...@@ -285,7 +287,7 @@ export function testNumber() : Result { ...@@ -285,7 +287,7 @@ export function testNumber() : Result {
}) })
test('toLong', () => { test('toLong', () => {
// #ifdef APP // #ifdef APP-ANDROID
// #TEST Number.toLong // #TEST Number.toLong
let a = 12 let a = 12
console.log(a.toLong()); console.log(a.toLong());
...@@ -298,7 +300,7 @@ export function testNumber() : Result { ...@@ -298,7 +300,7 @@ export function testNumber() : Result {
test('from', () => { test('from', () => {
// #ifdef APP // #ifdef APP
// #TEST Number.from // #TEST Number.from
let a = 12 let a: Int = 12
let b = Number.from(a) let b = Number.from(a)
console.log(b); console.log(b);
// expected output: 12 // expected output: 12
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册