mirror of
https://github.com/octoleo/restic.git
synced 2024-11-27 07:16:40 +00:00
555be49a79
The backend specific parts of the test are now directly handled by the respective backend. Duplicate tests were removed.
47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
package local
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/restic/restic/internal/backend/test"
|
|
)
|
|
|
|
var configTests = []test.ConfigTestData[Config]{
|
|
{S: "local:/some/path", Cfg: Config{
|
|
Path: "/some/path",
|
|
Connections: 2,
|
|
}},
|
|
{S: "local:dir1/dir2", Cfg: Config{
|
|
Path: "dir1/dir2",
|
|
Connections: 2,
|
|
}},
|
|
{S: "local:../dir1/dir2", Cfg: Config{
|
|
Path: "../dir1/dir2",
|
|
Connections: 2,
|
|
}},
|
|
{S: "local:/dir1:foobar/dir2", Cfg: Config{
|
|
Path: "/dir1:foobar/dir2",
|
|
Connections: 2,
|
|
}},
|
|
{S: `local:\dir1\foobar\dir2`, Cfg: Config{
|
|
Path: `\dir1\foobar\dir2`,
|
|
Connections: 2,
|
|
}},
|
|
{S: `local:c:\dir1\foobar\dir2`, Cfg: Config{
|
|
Path: `c:\dir1\foobar\dir2`,
|
|
Connections: 2,
|
|
}},
|
|
{S: `local:C:\Users\appveyor\AppData\Local\Temp\1\restic-test-879453535\repo`, Cfg: Config{
|
|
Path: `C:\Users\appveyor\AppData\Local\Temp\1\restic-test-879453535\repo`,
|
|
Connections: 2,
|
|
}},
|
|
{S: `local:c:/dir1/foobar/dir2`, Cfg: Config{
|
|
Path: `c:/dir1/foobar/dir2`,
|
|
Connections: 2,
|
|
}},
|
|
}
|
|
|
|
func TestParseConfig(t *testing.T) {
|
|
test.ParseConfigTester(t, ParseConfig, configTests)
|
|
}
|