Skip to content

Commit

Permalink
Fix check for nil or non-nil error
Browse files Browse the repository at this point in the history
  • Loading branch information
tdawe committed Dec 1, 2024
1 parent 22b5607 commit 905b90f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion service/service_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,11 @@ func TestGetZoneKeyLabelFromSecret(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
label, err := getZoneKeyLabelFromSecret(tt.arrays)
assert.Equal(t, err, tt.expectedErr)
if tt.expectedErr == nil {
assert.Nil(t, err)
} else {
assert.NotNil(t, err)
}
assert.Equal(t, label, tt.expectedLabel)
})
}
Expand Down

0 comments on commit 905b90f

Please sign in to comment.