fun returnInt(int:Int): Int{ return int }
fun Int.returnInt() = this- fun returnInt(int:Int): Int{
- return int
- }
import kotlin.test.Test import kotlin.test.assertEquals class ReturnIntTest { @Test fun `returnInt test`() { assertEquals(returnInt(-10), -10); } }
- import kotlin.test.Test
- import kotlin.test.assertEquals
- class ReturnIntTest {
- @Test
- fun `returnInt test`() {
assertEquals(10.returnInt(), 10);- assertEquals(returnInt(-10), -10);
- }
- }