mirror of
https://github.com/octoleo/restic.git
synced 2024-12-30 13:40:36 +00:00
22 lines
471 B
Go
22 lines
471 B
Go
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
|
|
}
|