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

补充内置测试对象实例

上级 10d260fe
......@@ -43,7 +43,7 @@ export function testArray(): Result {
})
test('convert-native', () => {
// #ifndef APP-ANDROID
// #ifdef APP-ANDROID
let utsArray = ["1",2,3.0]
let javaArray = utsArray.toTypedArray();
let kotlinArray = utsArray.toKotlinList()
......
......@@ -27,6 +27,12 @@ export function testDate() : Result {
let date1 = new Date('1992-02-02');
expect(date1.getTime()).toEqual(696988800000);
let date2 = new Date('Sun Feb 03 1991 08:00:00 GMT+0800');
expect(date2.getTime()).toEqual(665539200000);
let date3 = new Date('Sun Feb 03 1991');
expect(date3.getTime()).toEqual(665510400000);
// #ifdef APP-ANDROID
/**
* iso 8601 相关
......
......@@ -52,11 +52,13 @@ export function testRegExp(): Result {
expect(regex2.ignoreCase).toEqual(false);
})
test("RegExpExecArray", () => {
// #ifdef APP-ANDROID
const regex1 = RegExp('foo*', 'g');
const str1 = 'table football, foosball';
let array1:RegExpExecArray = regex1.exec(str1)!;
console.log(array1[0] == 'foo')
expect(array1[0] == 'foo').toEqual(true);
// #endif
})
test("lastIndex", () => {
const regex = /ab/g;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册