mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Merge pull request #125835 from benluddy/roundtrip-error-fmt-strings
Fix fmt verbs for strings in roundtrip test errors
This commit is contained in:
commit
8d0ee91fc7
@ -350,14 +350,14 @@ func roundTrip(t *testing.T, scheme *runtime.Scheme, codec runtime.Codec, object
|
|||||||
// decode (deserialize) the encoded data back into an object
|
// decode (deserialize) the encoded data back into an object
|
||||||
obj2, err := runtime.Decode(codec, data)
|
obj2, err := runtime.Decode(codec, data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("%v: %v\nCodec: %#v\nData: %s\nSource: %#v", name, err, codec, dataAsString(data), dump.Pretty(object))
|
t.Errorf("%v: %v\nCodec: %#v\nData: %s\nSource: %s", name, err, codec, dataAsString(data), dump.Pretty(object))
|
||||||
panic("failed")
|
panic("failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure that the object produced from decoding the encoded data is equal
|
// ensure that the object produced from decoding the encoded data is equal
|
||||||
// to the original object
|
// to the original object
|
||||||
if !apiequality.Semantic.DeepEqual(original, obj2) {
|
if !apiequality.Semantic.DeepEqual(original, obj2) {
|
||||||
t.Errorf("%v: diff: %v\nCodec: %#v\nSource:\n\n%#v\n\nEncoded:\n\n%s\n\nFinal:\n\n%#v", name, cmp.Diff(original, obj2), codec, dump.Pretty(original), dataAsString(data), dump.Pretty(obj2))
|
t.Errorf("%v: diff: %v\nCodec: %#v\nSource:\n\n%s\n\nEncoded:\n\n%s\n\nFinal:\n\n%s", name, cmp.Diff(original, obj2), codec, dump.Pretty(original), dataAsString(data), dump.Pretty(obj2))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user