Files
meta-core/internal/api/storage_helper_test.go
T
2026-10-19 20:51:00 +00:00

20 lines
429 B
Go

package api
import (
"path/filepath"
"testing"
"github.com/metazla/meta-core/internal/storage"
)
// newTestStorage opens a fresh metadata store in the test's temp dir.
func newTestStorage(t *testing.T) *storage.Client {
t.Helper()
c := storage.NewClient()
if err := c.Connect(filepath.Join(t.TempDir(), "meta-core.db")); err != nil {
t.Fatalf("open store: %v", err)
}
t.Cleanup(func() { _ = c.Close() })
return c
}