mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-28 10:20:05 +00:00
Return loop index in regex iterator.
This commit is contained in:
@@ -1127,13 +1127,12 @@ test_match_iterator :: proc(t: ^testing.T) {
|
||||
(err == nil) or_continue
|
||||
|
||||
count: int
|
||||
for capture in regex.match(&it) {
|
||||
for capture, idx in regex.match(&it) {
|
||||
if count > len(test.expected) {
|
||||
break
|
||||
}
|
||||
check_capture(t, capture, test.expected[count])
|
||||
count += 1
|
||||
check_capture(t, capture, test.expected[idx])
|
||||
}
|
||||
testing.expect_value(t, count, len(test.expected))
|
||||
testing.expect_value(t, it.idx, len(test.expected))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user