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

增加 RegExp RegExpExecArray 测试示例

上级 0c433417
......@@ -22522,7 +22522,6 @@ export function testJSONLarge() : Result {
return describe("JSON_large", () => {
test('parse', () => {
// #ifdef APP-ANDROID
UTSAndroid.getDispatcher("io").async(function(_){
let startTime = System.currentTimeMillis()
let listdata = JSON.parseArray<PICKER_ITEM_INFO>(allStr)
let spendTime = System.currentTimeMillis() - startTime
......@@ -22539,7 +22538,6 @@ export function testJSONLarge() : Result {
expect(parseArray.length).toEqual(33);
expect(spendTime < 300).toEqual(true);
console.log('不指定类型转换耗时',spendTime,listdata2)
},null)
// #endif
......
......@@ -51,6 +51,13 @@ export function testRegExp(): Result {
const regex2 = new RegExp('bar');
expect(regex2.ignoreCase).toEqual(false);
})
test("RegExpExecArray", () => {
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);
})
test("lastIndex", () => {
const regex = /ab/g;
const str = 'ab ab ab';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册