ShouldEqual makes use of Equality method (if defined) by mdwhatcott · Pull Request #21 · smarty/assertions · GitHub
Skip to content

ShouldEqual makes use of Equality method (if defined)#21

Merged
mdwhatcott merged 6 commits into
masterfrom
equality-method
Jul 31, 2017
Merged

ShouldEqual makes use of Equality method (if defined)#21
mdwhatcott merged 6 commits into
masterfrom
equality-method

Conversation

@mdwhatcott

Copy link
Copy Markdown
Contributor

This pull request allows time values to be compared using ShouldEqual. More generally, it allows any two structs (or pointers) to be compared if they are of the same time underlying type and that type implements a method named Equal that receives another instance of its own type as an input argument and returns a bool indicating whether to receiver and the argument are considered equal.

time.Time satisfies the requirements above with it's Equal method:

func (t Time) Equal(u Time) bool


See the following issues for context leading up to this pull request:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant