Procházet zdrojové kódy

Use `regex.destroy` for test captures

Feoramund před 1 rokem
rodič
revize
743480b1a4
1 změnil soubory, kde provedl 1 přidání a 4 odebrání
  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)