| 1 | package cli |
| 2 | |
| 3 | import ( |
| 4 | "reasonix/internal/control" |
| 5 | "testing" |
| 6 | ) |
| 7 | |
| 8 | func newOwnedTestController(t testing.TB, options control.Options) *control.Controller { |
| 9 | t.Helper() |
| 10 | controller := control.New(options) |
| 11 | t.Cleanup(func() { |
| 12 | controller.Close() |
| 13 | // Close requests teardown; Closed joins the final persistence work and |
| 14 | // releases stores before t.TempDir removes their files (notably Windows). |
| 15 | <-controller.Closed() |
| 16 | }) |
| 17 | return controller |
| 18 | } |
| 19 |