Skip to content

Commit

Permalink
add infix to shouldHaveSameHashCodeAs (#3258)
Browse files Browse the repository at this point in the history
  • Loading branch information
aSemy committed Oct 24, 2022
1 parent a123357 commit 4a91954
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -5,8 +5,8 @@ import io.kotest.matchers.MatcherResult
import io.kotest.matchers.should
import io.kotest.matchers.shouldNot

fun Any.shouldHaveSameHashCodeAs(other: Any) = this should haveSameHashCodeAs(other)
fun Any.shouldNotHaveSameHashCodeAs(other: Any) = this shouldNot haveSameHashCodeAs(other)
infix fun Any.shouldHaveSameHashCodeAs(other: Any) = this should haveSameHashCodeAs(other)
infix fun Any.shouldNotHaveSameHashCodeAs(other: Any) = this shouldNot haveSameHashCodeAs(other)

fun haveSameHashCodeAs(other: Any) = object : Matcher<Any> {
override fun test(value: Any): MatcherResult {
Expand Down

0 comments on commit 4a91954

Please sign in to comment.