Skip to content

Commit

Permalink
Introduced cmp for error comparison for util.ConvertStringToUnstructured
Browse files Browse the repository at this point in the history
Signed-off-by: tariq-hasan <mmtariquehsn@gmail.com>
  • Loading branch information
tariq-hasan committed Apr 16, 2024
1 parent 49ec35f commit 6d33aa5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller.v1beta1/experiment/manifest/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ spec:
- "--momentum=0.9"`

expectedRunSpec, err := util.ConvertStringToUnstructured(expectedStr)
if err != nil {
t.Errorf("%v: %v", errConvertStringToUnstructuredFailed, err)
if diff := cmp.Diff(nil, err, cmpopts.EquateErrors()); len(diff) != 0 {
t.Errorf("ConvertStringToUnstructured failed (-want,+got):\n%s", diff)
}

cases := map[string]struct {
Expand Down

0 comments on commit 6d33aa5

Please sign in to comment.