-
Notifications
You must be signed in to change notification settings - Fork 206
Closed
Description
Observed with version 6.1.0
When verifying a function call on a mock with a value class type argument, the eq() argument matcher does not match.
This is demonstrated with the following test:
@Test
fun eq_forValueClass() {
val valueClass = ValueClass("Content")
mock<Methods>().apply {
valueClass(valueClass)
verify(this).valueClass(eq(valueClass))
}
}
This test fails with the message:
Argument(s) are different! Wanted:
methods.valueClass-T-UsNSA(
ValueClass(content=Content)
);
-> at test.MatchersTest.eq_forValueClass(MatchersTest.kt:354)
Actual invocations have different arguments:
methods.valueClass-T-UsNSA(
"Content"
);
-> at test.MatchersTest.eq_forValueClass(MatchersTest.kt:353)
In extend to #522, the MR that added value class support to the any() and anyOrNull() implementations, also eq() should be enhanced to support value class arguments.
Metadata
Metadata
Assignees
Labels
No labels