Skip to content

Commit

Permalink
Refactored unit test that uses cmp.Diff
Browse files Browse the repository at this point in the history
Signed-off-by: tariq-hasan <[email protected]>
  • Loading branch information
tariq-hasan committed Apr 7, 2024
1 parent 59e489e commit 4c6db3c
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,12 @@ func TestConvertTrialObservation(t *testing.T) {
},
}
for _, tc := range tcs {
actualObservation := convertTrialObservation(tc.strategies, tc.inObservation)
if diff := cmp.Diff(actualObservation, tc.expectedObservation); diff != "" {
t.Errorf("Case: %v failed. Diff (-want,+got):\n%s", tc.testDescription, diff)
}
t.Run(tc.testDescription, func(t *testing.T) {
actualObservation := convertTrialObservation(tc.strategies, tc.inObservation)
if diff := cmp.Diff(actualObservation, tc.expectedObservation); diff != "" {
t.Errorf("Unexpected observation (-want,+got):\n%s", diff)
}
})
}
}

Expand Down

0 comments on commit 4c6db3c

Please sign in to comment.