Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Ensure we do have an error before testing it (#4301)
Browse files Browse the repository at this point in the history
  • Loading branch information
sylr authored and jackfrancis committed Nov 28, 2018
1 parent 7e65840 commit 390f454
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/api/vlabs/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1943,11 +1943,13 @@ func TestProperties_ValidateZones(t *testing.T) {
ExcludeMasterFromStandardLB: helpers.PointerToBool(test.excludeMasterFromStandardLB),
}

err := p.Validate(false)

expectedMsg := test.expectedErr
if err.Error() != expectedMsg {
t.Errorf("expected error with message : %s, but got : %s", expectedMsg, err.Error())
if err := p.Validate(false); err != nil {
expectedMsg := test.expectedErr
if err.Error() != expectedMsg {
t.Errorf("expected error with message : %s, but got : %s", expectedMsg, err.Error())
}
} else {
t.Errorf("error should have occurred")
}
})
}
Expand Down

0 comments on commit 390f454

Please sign in to comment.