2017-07-08 13:34:23 +00:00
|
|
|
package gs
|
|
|
|
|
2023-04-20 21:02:56 +00:00
|
|
|
import (
|
|
|
|
"testing"
|
2017-07-08 13:34:23 +00:00
|
|
|
|
2023-04-20 21:02:56 +00:00
|
|
|
"github.com/restic/restic/internal/backend/test"
|
|
|
|
)
|
|
|
|
|
|
|
|
var configTests = []test.ConfigTestData[Config]{
|
2017-07-08 13:34:23 +00:00
|
|
|
{"gs:bucketname:/", Config{
|
|
|
|
Bucket: "bucketname",
|
|
|
|
Prefix: "",
|
|
|
|
Connections: 5,
|
2023-02-27 06:53:25 +00:00
|
|
|
Region: "us",
|
2017-07-08 13:34:23 +00:00
|
|
|
}},
|
|
|
|
{"gs:bucketname:/prefix/directory", Config{
|
|
|
|
Bucket: "bucketname",
|
|
|
|
Prefix: "prefix/directory",
|
|
|
|
Connections: 5,
|
2023-02-27 06:53:25 +00:00
|
|
|
Region: "us",
|
2017-07-08 13:34:23 +00:00
|
|
|
}},
|
|
|
|
{"gs:bucketname:/prefix/directory/", Config{
|
|
|
|
Bucket: "bucketname",
|
|
|
|
Prefix: "prefix/directory",
|
|
|
|
Connections: 5,
|
2023-02-27 06:53:25 +00:00
|
|
|
Region: "us",
|
2017-07-08 13:34:23 +00:00
|
|
|
}},
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestParseConfig(t *testing.T) {
|
2023-04-20 21:02:56 +00:00
|
|
|
test.ParseConfigTester(t, ParseConfig, configTests)
|
2017-07-08 13:34:23 +00:00
|
|
|
}
|