function annotation and some docs for it
This commit is contained in:
1 parent
804087f16d
commit
9704f18284
7 files changed
+119
-15
No files matched your search
@@ -2831,4 +2831,28 @@ class ScriptTest {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun tesFunAnnotation() = runTest {
|
||||
eval("""
|
||||
|
||||
val exportedSymbols = Map()
|
||||
|
||||
fun Exported(name, f, overrideName = null) {
|
||||
assertEquals(name, "getBalance")
|
||||
assertEquals(null, overrideName)
|
||||
exportedSymbols[ overrideName ?: name ] = f
|
||||
f
|
||||
}
|
||||
|
||||
@Exported
|
||||
fun getBalance(x = 0) {
|
||||
121 + x
|
||||
}
|
||||
|
||||
assert( exportedSymbols["getBalance"] != null )
|
||||
assertEquals(122, getBalance(1))
|
||||
|
||||
""".trimIndent())
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user