Skip to content

Commit fa6a72c

Browse files
committed
Include a test ensuring returns non-nullable type
1 parent ffaddbb commit fa6a72c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/src/test/kotlin/test/MatchersTest.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,19 @@ class MatchersTest : TestBase() {
228228
expect(t.varargBooleanResult("a", "b", "c")).toBe(false)
229229
}
230230

231+
/** https://github.com/nhaarman/mockito-kotlin/issues/328 */
232+
@Test
233+
fun testRefEqForNonNullableParameter() {
234+
mock<Methods>().apply {
235+
/* When */
236+
val array = intArrayOf(2, 3)
237+
intArray(array)
238+
239+
/* Then */
240+
verify(this).intArray(refEq(array))
241+
}
242+
}
243+
231244
/**
232245
* a VarargMatcher implementation for varargs of type [T] that will answer with type [R] if any of the var args
233246
* matched. Needs to keep state between matching invocations.

0 commit comments

Comments
 (0)