mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-15 23:54:07 +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)
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user