1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

regex: fixes and optimizations (#7431)

This commit is contained in:
penguindark
2020-12-21 05:36:14 +01:00
committed by GitHub
parent 82d1b6a5b7
commit c9171ebe9a
3 changed files with 17 additions and 2 deletions

View File

@ -138,6 +138,9 @@ match_test_suite = [
TestItem{"*1*1(", r"(?:^|[*()])(\d+)([*])(\d+)(?:$|[*()])",0,5},
TestItem{" 1*1(", r"(?:^|[*()])(\d+)([*])(\d+)(?:$|[*()])",-1,0},
TestItem{"1*1 ", r"(?:^|[*()])(\d+)([*])(\d+)(?:$|[*()])",-1,0},
// particular groups
TestItem{"ababababac", r"ab(.*)(ac)",0,10},
]
)
@ -229,6 +232,12 @@ cgroups_test_suite = [
[0, 3, 4, 5, 5, 7],
map[string]int{}
},
TestItemCGroup{
"ababababac",
r"ab(.*)(ac)",0,10,
[2, 8, 8, 10],
map[string]int{}
},
]
)