diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/config_test.go | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/config/config_test.go b/config/config_test.go index 5a1dd38..dfa8237 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -49,10 +49,13 @@ func TestLoadFile(t *testing.T) { }, }, } - if config, err := LoadFile("test_data/minimal.yaml"); err != nil || !reflect.DeepEqual(want, *config) { - t.Fatalf("minimal example failed:\nerror %v\nwant:%+v\ngot: %+v", err, want, *config) + config, err := LoadFile("test_data/minimal.yaml") + if err != nil { + t.Fatalf("minimal example failed with error : %v", err) + } + if config != nil && !reflect.DeepEqual(want, *config) { + t.Fatalf("minimal example failed:\nwant:%+v\ngot: %+v", want, *config) } - t.Cleanup(func() { os.RemoveAll("var/") }) // Invalid App if _, err := LoadFile("test_data/invalid_app.yaml"); err == nil { @@ -208,7 +211,11 @@ func TestLoadFile(t *testing.T) { }, }, } - if config, err := LoadFile("../example/complete.yaml"); err != nil || !reflect.DeepEqual(want, *config) { - t.Fatalf("complete example failed:\nerror %v\nwant:%+v\ngot: %+v", err, want, *config) + config, err = LoadFile("../example/complete.yaml") + if err != nil { + t.Fatalf("complete example failed with error : %v", err) + } + if config != nil && !reflect.DeepEqual(want, *config) { + t.Fatalf("complete example failed:\nwant:%+v\ngot: %+v", want, *config) } } |