Skip to content

Commit 5e3b021

Browse files
committed
(WIP) default arguments
1 parent a7f8642 commit 5e3b021

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.example
2+
3+
import androidx.compose.runtime.*
4+
5+
@Composable
6+
fun default_arguments(i: Int = 42) {
7+
if (i > 10) {
8+
nop()
9+
} else {
10+
nop()
11+
}
12+
}
13+
14+
@Composable
15+
fun nop() {
16+
}

src/test/kotlin/org/example/ExampleTest.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,12 @@ class ExampleTest {
2222
compose.onNodeWithText("Click me again").assertDoesNotExist()
2323
}
2424

25+
@Test
26+
fun test_default_arguments() {
27+
compose.setContent {
28+
default_arguments()
29+
default_arguments(0)
30+
}
31+
}
32+
2533
}

0 commit comments

Comments
 (0)