Add assert-related testing functions, findFirst/findFirstOrNull methods, and expand documentation.
This commit is contained in:
1 parent
99f883cfc7
commit
3ac7fd7ceb
8 files changed
+193
-16
No files matched your search
@@ -4270,4 +4270,18 @@ class ScriptTest {
|
||||
assertEquals(51, r.toInt())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testFirstInEnum() = runTest {
|
||||
eval("""
|
||||
enum E {
|
||||
one, two, three
|
||||
}
|
||||
println(E.entries)
|
||||
assertEquals( E.two, E.entries.findFirst {
|
||||
println(it.name)
|
||||
it.name in ["aaa", "two"]
|
||||
} )
|
||||
|
||||
""".trimIndent())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user