Browse Source

Use `regex.destroy` for test captures

Feoramund 1 year ago
parent
commit
743480b1a4
1 changed files with 1 additions and 4 deletions
  1. 1 4
      tests/core/text/regex/test_core_text_regex.odin

+ 1 - 4
tests/core/text/regex/test_core_text_regex.odin

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