Update deprecated diff.ObjectGoPrintDiff method

Use `diff.ObjectGoPrintSideBySide` to print the difference.
This commit is contained in:
Ajat Prabha 2019-07-17 17:25:34 +05:30 committed by GitHub
parent 29669a5e21
commit 291c145bc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -182,7 +182,7 @@ func checkAction(expected, actual core.Action, t *testing.T) {
if !reflect.DeepEqual(expObject, object) {
t.Errorf("Action %s %s has wrong object\nDiff:\n %s",
a.GetVerb(), a.GetResource().Resource, diff.ObjectGoPrintDiff(expObject, object))
a.GetVerb(), a.GetResource().Resource, diff.ObjectGoPrintSideBySide(expObject, object))
}
case core.UpdateAction:
e, _ := expected.(core.UpdateAction)
@ -191,7 +191,7 @@ func checkAction(expected, actual core.Action, t *testing.T) {
if !reflect.DeepEqual(expObject, object) {
t.Errorf("Action %s %s has wrong object\nDiff:\n %s",
a.GetVerb(), a.GetResource().Resource, diff.ObjectGoPrintDiff(expObject, object))
a.GetVerb(), a.GetResource().Resource, diff.ObjectGoPrintSideBySide(expObject, object))
}
case core.PatchAction:
e, _ := expected.(core.PatchAction)
@ -200,7 +200,7 @@ func checkAction(expected, actual core.Action, t *testing.T) {
if !reflect.DeepEqual(expPatch, patch) {
t.Errorf("Action %s %s has wrong patch\nDiff:\n %s",
a.GetVerb(), a.GetResource().Resource, diff.ObjectGoPrintDiff(expPatch, patch))
a.GetVerb(), a.GetResource().Resource, diff.ObjectGoPrintSideBySide(expPatch, patch))
}
}
}