Use regex.destroy for test captures

This commit is contained in:
Feoramund
2024-08-04 18:51:40 -04:00
parent 1ccb0b2558
commit 743480b1a4

View File

@@ -21,10 +21,7 @@ check_expression_with_flags :: proc(t: ^testing.T, pattern: string, flags: regex
defer regex.destroy(rex)
capture, success := regex.match(rex, haystack)
defer {
delete(capture.groups)
delete(capture.pos)
}
defer regex.destroy(capture)
if len(needles) > 0 {
testing.expect(t, success, "match failed", loc = loc)