functions are rewritten to new standard argparser/emitter too
This commit is contained in:
1 parent
71a2933066
commit
9a08da0dfd
2 files changed
+25
-46
No files matched your search
@@ -528,7 +528,7 @@ class ScriptTest {
|
||||
// equal args,
|
||||
// less args, no ellipsis, defaults, ok
|
||||
val ttEnd = Token.Type.RBRACE
|
||||
var pa = ArgsDeclaration(listOf(
|
||||
val pa = ArgsDeclaration(listOf(
|
||||
ArgsDeclaration.Item("a"),
|
||||
ArgsDeclaration.Item("b", isEllipsis = true),
|
||||
), ttEnd)
|
||||
@@ -551,7 +551,7 @@ class ScriptTest {
|
||||
@Test
|
||||
fun testAssignArgumentsStartEllipsis() = runTest {
|
||||
val ttEnd = Token.Type.RBRACE
|
||||
var pa = ArgsDeclaration(listOf(
|
||||
val pa = ArgsDeclaration(listOf(
|
||||
ArgsDeclaration.Item("a", isEllipsis = true),
|
||||
ArgsDeclaration.Item("b"),
|
||||
ArgsDeclaration.Item("c"),
|
||||
@@ -583,7 +583,7 @@ class ScriptTest {
|
||||
@Test
|
||||
fun testAssignArgumentsmiddleEllipsis() = runTest {
|
||||
val ttEnd = Token.Type.RBRACE
|
||||
var pa = ArgsDeclaration(listOf(
|
||||
val pa = ArgsDeclaration(listOf(
|
||||
ArgsDeclaration.Item("i"),
|
||||
ArgsDeclaration.Item("a", isEllipsis = true),
|
||||
ArgsDeclaration.Item("b"),
|
||||
@@ -1306,6 +1306,17 @@ class ScriptTest {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testNewFnParser() = runTest {
|
||||
eval(
|
||||
"""
|
||||
fun f1(a,b) { a + b }
|
||||
println(f1(1,2))
|
||||
assertEquals( 7, f1(3,4) )
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSpoilArgsBug() = runTest {
|
||||
eval(
|
||||
|
||||
Reference in new issue
Block a user