2016-01-23 13:19:26 -05:00
|
|
|
package mem_test
|
2016-01-23 11:42:26 -05:00
|
|
|
|
|
|
|
|
import (
|
2017-05-01 16:56:05 -04:00
|
|
|
"testing"
|
2016-08-31 16:51:35 -04:00
|
|
|
|
2017-07-23 08:21:03 -04:00
|
|
|
"github.com/restic/restic/internal/backend/mem"
|
|
|
|
|
"github.com/restic/restic/internal/backend/test"
|
2016-01-23 11:42:26 -05:00
|
|
|
)
|
|
|
|
|
|
2023-06-08 10:53:55 -04:00
|
|
|
func newTestSuite() *test.Suite[struct{}] {
|
|
|
|
|
return &test.Suite[struct{}]{
|
2017-05-01 16:56:05 -04:00
|
|
|
// NewConfig returns a config for a new temporary backend that will be used in tests.
|
2023-06-08 10:53:55 -04:00
|
|
|
NewConfig: func() (*struct{}, error) {
|
|
|
|
|
return &struct{}{}, nil
|
2017-05-01 16:56:05 -04:00
|
|
|
},
|
|
|
|
|
|
2023-06-08 10:53:55 -04:00
|
|
|
Factory: mem.NewFactory(),
|
2016-01-23 11:42:26 -05:00
|
|
|
}
|
2017-05-13 15:47:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestSuiteBackendMem(t *testing.T) {
|
|
|
|
|
newTestSuite().RunTests(t)
|
|
|
|
|
}
|
2016-01-23 11:42:26 -05:00
|
|
|
|
2017-05-13 15:47:01 -04:00
|
|
|
func BenchmarkSuiteBackendMem(t *testing.B) {
|
|
|
|
|
newTestSuite().RunBenchmarks(t)
|
2016-01-23 11:42:26 -05:00
|
|
|
}
|