Skip to content

Commit

Permalink
Simplifies conditions in test
Browse files Browse the repository at this point in the history
  • Loading branch information
mik-dass committed Jun 17, 2020
1 parent e0372c0 commit 9a57629
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkg/devfile/adapters/common/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,12 +498,15 @@ func TestGetDebugCommand(t *testing.T) {

command, err := GetDebugCommand(devObj.Data, tt.commandName)

if !tt.wantErr == (err != nil) {
t.Errorf("TestGetDebugCommand: unexpected error for command \"%v\" expected: %v actual: %v", tt.commandName, tt.wantErr, err)
} else if !tt.wantErr && reflect.DeepEqual(emptyCommand, command) {
t.Errorf("TestGetDebugCommand: unexpected empty command returned for command: %v", tt.commandName)
if tt.wantErr && err == nil {
t.Errorf("Error was expected but got no error")
} else if !tt.wantErr {
if err != nil {
t.Errorf("TestGetDebugCommand: unexpected error for command \"%v\" expected: %v actual: %v", tt.commandName, tt.wantErr, err)
} else if reflect.DeepEqual(emptyCommand, command) {
t.Errorf("TestGetDebugCommand: unexpected empty command returned for command: %v", tt.commandName)
}
}

})
}
}
Expand Down

0 comments on commit 9a57629

Please sign in to comment.