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