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

增加 RegExpExecArray声明类型测试示例

上级 923b79f0
......@@ -51,6 +51,15 @@ export function testRegExp(): Result {
const regex2 = new RegExp('bar');
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;
const str = 'ab ab ab';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册