Skip to content

Commit 643ecda

Browse files
committed
Added reproducer for mockk/mockk#1342.
1 parent 733fee2 commit 643ecda

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package org.sdkotlin.tdd.mockk
2+
3+
import io.mockk.every
4+
import io.mockk.mockk
5+
import org.assertj.core.api.Assertions.assertThat
6+
import org.junit.jupiter.api.Disabled
7+
import org.junit.jupiter.api.Test
8+
9+
interface ValueClassSuperType
10+
11+
@JvmInline
12+
value class ValueClass(val s: String) : ValueClassSuperType
13+
14+
data class TestDataClass(val v: ValueClassSuperType)
15+
16+
class MockKValueClassParameterTest {
17+
18+
@Test
19+
@Disabled("https://github.com/mockk/mockk/issues/1342")
20+
fun `test value class parameter`() {
21+
22+
val testValue = ValueClass("testing")
23+
24+
val mock = mockk<TestDataClass> {
25+
every { v } returns testValue
26+
}
27+
28+
assertThat(mock.v).isEqualTo(testValue)
29+
}
30+
}

0 commit comments

Comments
 (0)