You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For testing purposes it'd be really valuable to have message and field equality functions.
Currently, in order to check whether two messages are equal, we are forced to manually assert on every field (including nil ones) to ensure that every value is equal.
It would be great to have equality functions for messages that recursively check that fields and subfields are either nil or have equal values.
The same should be possible on a field / subfield level as well. This likely requires us to extend the field.Field interface to have an Equal(Field) bool function as well.
For the Message object, we could either add on a Equal(m *Message) bool method onto the *Message receiver or add on a utility function along the lines of: func Equal(x *Message, y *Message) bool
The text was updated successfully, but these errors were encountered:
For testing purposes it'd be really valuable to have message and field equality functions.
Currently, in order to check whether two messages are equal, we are forced to manually assert on every field (including nil ones) to ensure that every value is equal.
It would be great to have equality functions for messages that recursively check that fields and subfields are either nil or have equal values.
The same should be possible on a field / subfield level as well. This likely requires us to extend the
field.Field
interface to have anEqual(Field) bool
function as well.For the
Message
object, we could either add on aEqual(m *Message) bool
method onto the*Message
receiver or add on a utility function along the lines of:func Equal(x *Message, y *Message) bool
The text was updated successfully, but these errors were encountered: