mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Use regex.destroy for test captures
This commit is contained in:
@@ -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 {
|
defer regex.destroy(capture)
|
||||||
delete(capture.groups)
|
|
||||||
delete(capture.pos)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(needles) > 0 {
|
if len(needles) > 0 {
|
||||||
testing.expect(t, success, "match failed", loc = loc)
|
testing.expect(t, success, "match failed", loc = loc)
|
||||||
|
|||||||
Reference in New Issue
Block a user