Skip to content

Commit

Permalink
Fix get default config test
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaitodor authored and mgechev committed Oct 4, 2021
1 parent 62db669 commit 099eeac
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ func TestGetConfig(t *testing.T) {
wantError: "cannot parse the config file",
},
"default config": {
wantConfig: defaultConfig(),
wantConfig: func() *lint.Config {
c := defaultConfig()
normalizeConfig(c)
return c
}(),
},
}

Expand All @@ -40,7 +44,7 @@ func TestGetConfig(t *testing.T) {
t.Fatalf("Unexpected error\n\t%v", err)
case err != nil && !strings.Contains(err.Error(), tc.wantError):
t.Fatalf("Expected error\n\t%q\ngot:\n\t%v", tc.wantError, err)
case tc.wantConfig != nil && reflect.DeepEqual(cfg, tc.wantConfig):
case tc.wantConfig != nil && !reflect.DeepEqual(cfg, tc.wantConfig):
t.Fatalf("Expected config\n\t%+v\ngot:\n\t%+v", tc.wantConfig, cfg)
}

Expand Down

0 comments on commit 099eeac

Please sign in to comment.