forked from TrueCloudLab/restic
backend: let ParseConfig return concrete type
This commit is contained in:
parent
2f7b4ceae1
commit
5260d38980
17 changed files with 55 additions and 62 deletions
|
@ -33,16 +33,11 @@ var configTests = []struct {
|
|||
func TestParseConfig(t *testing.T) {
|
||||
for _, test := range configTests {
|
||||
t.Run("", func(t *testing.T) {
|
||||
v, err := ParseConfig(test.s)
|
||||
cfg, err := ParseConfig(test.s)
|
||||
if err != nil {
|
||||
t.Fatalf("parsing %q failed: %v", test.s, err)
|
||||
}
|
||||
|
||||
cfg, ok := v.(Config)
|
||||
if !ok {
|
||||
t.Fatalf("wrong type returned, want Config, got %T", cfg)
|
||||
}
|
||||
|
||||
if cfg != test.cfg {
|
||||
t.Fatalf("wrong output for %q, want:\n %#v\ngot:\n %#v",
|
||||
test.s, test.cfg, cfg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue