summaryrefslogtreecommitdiff
path: root/internal/store/store_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-02 10:56:42 +0200
committerPaul Buetow <paul@buetow.org>2026-03-02 10:56:42 +0200
commitb636b12566ea6c2862bf3adc6686c57e0d785ca3 (patch)
tree5c94a13179bf4a6bba5616f8bbd74ec8d61e4d0c /internal/store/store_test.go
parent88f6ca2fb24973b78afe76f82ea86171e40fccff (diff)
store: make Data carry injected deps (task 402)
Diffstat (limited to 'internal/store/store_test.go')
-rw-r--r--internal/store/store_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/store/store_test.go b/internal/store/store_test.go
index 270fe00..86b7d0d 100644
--- a/internal/store/store_test.go
+++ b/internal/store/store_test.go
@@ -139,7 +139,7 @@ func TestAddAndSearch(t *testing.T) {
}
dataPath := filepath.Join(cfg.DataDir, idx.DataFile)
- d, err := loadData(ctx, dataPath, c)
+ d, err := loadData(ctx, dataPath, c, nil)
if err != nil {
t.Fatalf("loadData: %v", err)
}
@@ -221,7 +221,7 @@ func TestImport(t *testing.T) {
}
dataPath := filepath.Join(cfg.DataDir, found[0].DataFile)
- d, err := loadData(ctx, dataPath, c)
+ d, err := loadData(ctx, dataPath, c, nil)
if err != nil {
t.Fatalf("loadData: %v", err)
}
@@ -259,7 +259,7 @@ func TestExport(t *testing.T) {
}
dataPath := filepath.Join(cfg.DataDir, idx.DataFile)
- d, err := loadData(ctx, dataPath, c)
+ d, err := loadData(ctx, dataPath, c, nil)
if err != nil {
t.Fatalf("loadData: %v", err)
}
@@ -595,7 +595,7 @@ func TestImportRecursive(t *testing.T) {
}())
continue
}
- d, err := loadData(ctx, filepath.Join(cfg.DataDir, idx.DataFile), c)
+ d, err := loadData(ctx, filepath.Join(cfg.DataDir, idx.DataFile), c, nil)
if err != nil {
t.Fatalf("loadData for %q: %v", desc, err)
}
@@ -624,7 +624,7 @@ func TestReimportAfterExport(t *testing.T) {
t.Fatalf("WalkIndexes: %v", err)
}
- d, err := loadData(ctx, filepath.Join(cfg.DataDir, idx.DataFile), c)
+ d, err := loadData(ctx, filepath.Join(cfg.DataDir, idx.DataFile), c, g)
if err != nil {
t.Fatalf("loadData: %v", err)
}
@@ -641,12 +641,12 @@ func TestReimportAfterExport(t *testing.T) {
}
// Reimport overwrites the encrypted .data with the updated content.
- if err := d.ReimportAfterExport(ctx, c, g); err != nil {
+ if err := d.ReimportAfterExport(ctx); err != nil {
t.Fatalf("ReimportAfterExport: %v", err)
}
// Reload from disk and verify the update was persisted.
- reloaded, err := loadData(ctx, filepath.Join(cfg.DataDir, idx.DataFile), c)
+ reloaded, err := loadData(ctx, filepath.Join(cfg.DataDir, idx.DataFile), c, nil)
if err != nil {
t.Fatalf("loadData after reimport: %v", err)
}
@@ -1029,7 +1029,7 @@ func TestImportForceOverwrite(t *testing.T) {
if err := store.WalkIndexes(ctx, "", func(i *Index) error { idx = i; return nil }); err != nil {
t.Fatalf("WalkIndexes: %v", err)
}
- d, err := loadData(ctx, filepath.Join(cfg.DataDir, idx.DataFile), c)
+ d, err := loadData(ctx, filepath.Join(cfg.DataDir, idx.DataFile), c, nil)
if err != nil {
t.Fatalf("loadData: %v", err)
}