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

增加Array 与原生类型转换测试

上级 c7493e51
......@@ -42,6 +42,20 @@ export function testArray(): Result {
})
test('convert-native', () => {
// #ifndef APP-ANDROID
let utsArray = ["1",2,3.0]
let javaArray = utsArray.toTypedArray();
let kotlinArray = utsArray.toKotlinList()
let convertArrayFromJava = Array.fromNative(javaArray);
let convertArrayFromKotlin = Array.fromNative(kotlinArray);
expect(convertArrayFromJava[0] == convertArrayFromKotlin[0]).toEqual(true);
expect(convertArrayFromJava[0]).toEqual("1");
// #endif
})
test('length', () => {
const arr = ['shoes', 'shirts', 'socks', 'sweaters'];
expect(arr.length).toEqual(4);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册