Skip to content

Commit

Permalink
Fix confusing test failure message
Browse files Browse the repository at this point in the history
Resolves #10466.

Signed-off-by: Simon Alling <alling.simon@gmail.com>
  • Loading branch information
SimonAlling committed Apr 12, 2022
1 parent cba3b1e commit 56e52d1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/helm/helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ func runTestCmd(t *testing.T, tests []cmdTestCase) {
}
t.Logf("running cmd (attempt %d): %s", i+1, tt.cmd)
_, out, err := executeActionCommandC(storage, tt.cmd)
if (err != nil) != tt.wantError {
t.Errorf("expected error, got '%v'", err)
if tt.wantError && err == nil {
t.Errorf("expected error, got success with the following output:\n%s", out)
}
if !tt.wantError && err != nil {
t.Errorf("expected no error, got: '%v'", err)
}
if tt.golden != "" {
test.AssertGoldenString(t, out, tt.golden)
Expand Down

0 comments on commit 56e52d1

Please sign in to comment.