aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFeoramund <161657516+Feoramund@users.noreply.github.com>2025-05-23 20:20:59 -0400
committerFeoramund <161657516+Feoramund@users.noreply.github.com>2025-05-24 07:23:04 -0400
commitfedb9efb413dda3f2d9d4bbb39050219f8c0f394 (patch)
tree065a9ea9b253baace469aad0cce38645e444101f /tests
parenta2c0720fb046187bb00f5f3beeab4e9c284b18f0 (diff)
Make RegEx VM restartable and fix iterator infinite loop
Diffstat (limited to 'tests')
-rw-r--r--tests/core/text/regex/test_core_text_regex.odin5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/core/text/regex/test_core_text_regex.odin b/tests/core/text/regex/test_core_text_regex.odin
index 913e716e5..8b4e3f997 100644
--- a/tests/core/text/regex/test_core_text_regex.odin
+++ b/tests/core/text/regex/test_core_text_regex.odin
@@ -1119,7 +1119,7 @@ iterator_vectors := []Iterator_Test{
@test
test_match_iterator :: proc(t: ^testing.T) {
- for test in iterator_vectors {
+ vector: for test in iterator_vectors {
it, err := regex.create_iterator(test.haystack, test.pattern, test.flags)
defer regex.destroy(it)
@@ -1128,7 +1128,8 @@ test_match_iterator :: proc(t: ^testing.T) {
for capture, idx in regex.match(&it) {
if idx >= len(test.expected) {
- break
+ log.errorf("got more than expected number of captures for matching string %q against pattern %q\n\tidx %i = %v", test.haystack, test.pattern, idx, capture)
+ continue vector
}
check_capture(t, capture, test.expected[idx])
}