mirror of
https://github.com/restic/restic.git
synced 2025-01-03 13:45:20 +00:00
archiver: remove unused masterIndex from test
This commit is contained in:
parent
0aa5c53842
commit
c01bcb1001
1 changed files with 1 additions and 10 deletions
|
@ -10,7 +10,6 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/restic/restic/internal/errors"
|
"github.com/restic/restic/internal/errors"
|
||||||
"github.com/restic/restic/internal/index"
|
|
||||||
"github.com/restic/restic/internal/restic"
|
"github.com/restic/restic/internal/restic"
|
||||||
rtest "github.com/restic/restic/internal/test"
|
rtest "github.com/restic/restic/internal/test"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
|
@ -19,7 +18,6 @@ import (
|
||||||
var errTest = errors.New("test error")
|
var errTest = errors.New("test error")
|
||||||
|
|
||||||
type saveFail struct {
|
type saveFail struct {
|
||||||
idx restic.MasterIndex
|
|
||||||
cnt int32
|
cnt int32
|
||||||
failAt int32
|
failAt int32
|
||||||
}
|
}
|
||||||
|
@ -33,18 +31,12 @@ func (b *saveFail) SaveBlob(_ context.Context, _ restic.BlobType, _ []byte, id r
|
||||||
return id, false, 0, nil
|
return id, false, 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *saveFail) Index() restic.MasterIndex {
|
|
||||||
return b.idx
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestBlobSaver(t *testing.T) {
|
func TestBlobSaver(t *testing.T) {
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
wg, ctx := errgroup.WithContext(ctx)
|
wg, ctx := errgroup.WithContext(ctx)
|
||||||
saver := &saveFail{
|
saver := &saveFail{}
|
||||||
idx: index.NewMasterIndex(),
|
|
||||||
}
|
|
||||||
|
|
||||||
b := NewBlobSaver(ctx, wg, saver, uint(runtime.NumCPU()))
|
b := NewBlobSaver(ctx, wg, saver, uint(runtime.NumCPU()))
|
||||||
|
|
||||||
|
@ -100,7 +92,6 @@ func TestBlobSaverError(t *testing.T) {
|
||||||
|
|
||||||
wg, ctx := errgroup.WithContext(ctx)
|
wg, ctx := errgroup.WithContext(ctx)
|
||||||
saver := &saveFail{
|
saver := &saveFail{
|
||||||
idx: index.NewMasterIndex(),
|
|
||||||
failAt: int32(test.failAt),
|
failAt: int32(test.failAt),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue