mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 23:06:32 +00:00
39 lines
616 B
Go
39 lines
616 B
Go
package rest
|
|
|
|
import (
|
|
"net/url"
|
|
"testing"
|
|
|
|
"github.com/restic/restic/internal/backend/test"
|
|
)
|
|
|
|
func parseURL(s string) *url.URL {
|
|
u, err := url.Parse(s)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
return u
|
|
}
|
|
|
|
var configTests = []test.ConfigTestData[Config]{
|
|
{
|
|
S: "rest:http://localhost:1234",
|
|
Cfg: Config{
|
|
URL: parseURL("http://localhost:1234/"),
|
|
Connections: 5,
|
|
},
|
|
},
|
|
{
|
|
S: "rest:http://localhost:1234/",
|
|
Cfg: Config{
|
|
URL: parseURL("http://localhost:1234/"),
|
|
Connections: 5,
|
|
},
|
|
},
|
|
}
|
|
|
|
func TestParseConfig(t *testing.T) {
|
|
test.ParseConfigTester(t, ParseConfig, configTests)
|
|
}
|