mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 14:56:29 +00:00
34 lines
495 B
Go
34 lines
495 B
Go
|
package rclone
|
||
|
|
||
|
import (
|
||
|
"reflect"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestParseConfig(t *testing.T) {
|
||
|
var tests = []struct {
|
||
|
s string
|
||
|
cfg Config
|
||
|
}{
|
||
|
{
|
||
|
"rclone:local:foo:/bar",
|
||
|
Config{
|
||
|
Remote: "local:foo:/bar",
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
|
||
|
for _, test := range tests {
|
||
|
t.Run("", func(t *testing.T) {
|
||
|
cfg, err := ParseConfig(test.s)
|
||
|
if err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
|
||
|
if !reflect.DeepEqual(cfg, test.cfg) {
|
||
|
t.Fatalf("wrong config, want:\n %v\ngot:\n %v", test.cfg, cfg)
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
}
|