mirror of
https://github.com/octoleo/restic.git
synced 2024-11-23 13:17:42 +00:00
Fix archiver test
This commit is contained in:
parent
619939ccd9
commit
573410afab
@ -2,10 +2,10 @@ package archiver
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"restic"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"restic/pipe"
|
"restic/pipe"
|
||||||
|
"restic/walk"
|
||||||
)
|
)
|
||||||
|
|
||||||
var treeJobs = []string{
|
var treeJobs = []string{
|
||||||
@ -83,12 +83,12 @@ func (j testPipeJob) Error() error { return j.err }
|
|||||||
func (j testPipeJob) Info() os.FileInfo { return j.fi }
|
func (j testPipeJob) Info() os.FileInfo { return j.fi }
|
||||||
func (j testPipeJob) Result() chan<- pipe.Result { return j.res }
|
func (j testPipeJob) Result() chan<- pipe.Result { return j.res }
|
||||||
|
|
||||||
func testTreeWalker(done <-chan struct{}, out chan<- restic.WalkTreeJob) {
|
func testTreeWalker(done <-chan struct{}, out chan<- walk.TreeJob) {
|
||||||
for _, e := range treeJobs {
|
for _, e := range treeJobs {
|
||||||
select {
|
select {
|
||||||
case <-done:
|
case <-done:
|
||||||
return
|
return
|
||||||
case out <- restic.WalkTreeJob{Path: e}:
|
case out <- walk.TreeJob{Path: e}:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ func testPipeWalker(done <-chan struct{}, out chan<- pipe.Job) {
|
|||||||
func TestArchivePipe(t *testing.T) {
|
func TestArchivePipe(t *testing.T) {
|
||||||
done := make(chan struct{})
|
done := make(chan struct{})
|
||||||
|
|
||||||
treeCh := make(chan restic.WalkTreeJob)
|
treeCh := make(chan walk.TreeJob)
|
||||||
pipeCh := make(chan pipe.Job)
|
pipeCh := make(chan pipe.Job)
|
||||||
|
|
||||||
go testTreeWalker(done, treeCh)
|
go testTreeWalker(done, treeCh)
|
||||||
|
Loading…
Reference in New Issue
Block a user