mirror of
https://github.com/restic/restic.git
synced 2025-08-14 03:37:43 +00:00
index: move to repository package
This commit is contained in:
21
internal/repository/index/testing.go
Normal file
21
internal/repository/index/testing.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package index
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/restic/restic/internal/restic"
|
||||
"github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
func TestMergeIndex(t testing.TB, mi *MasterIndex) ([]*Index, int, restic.IDSet) {
|
||||
finalIndexes := mi.finalizeNotFinalIndexes()
|
||||
ids := restic.NewIDSet()
|
||||
for _, idx := range finalIndexes {
|
||||
id := restic.NewRandomID()
|
||||
ids.Insert(id)
|
||||
test.OK(t, idx.SetID(id))
|
||||
}
|
||||
|
||||
test.OK(t, mi.MergeFinalIndexes())
|
||||
return finalIndexes, len(mi.idx), ids
|
||||
}
|
Reference in New Issue
Block a user