Bytecode compile in/not in via contains
This commit is contained in:
1 parent
63bcb91504
commit
250220a42f
2 files changed
+37
No files matched your search
@@ -5201,6 +5201,20 @@ class ScriptTest {
|
||||
assertEquals(ObjInt(2), scope.eval("firstEvenOrMinus()"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testInOperatorBytecode() = runTest {
|
||||
val scope = Script.newScope()
|
||||
scope.eval(
|
||||
"""
|
||||
fun inList(x, xs) { x in xs }
|
||||
""".trimIndent()
|
||||
)
|
||||
val disasm = scope.disassembleSymbol("inList")
|
||||
assertFalse(disasm.contains("not a compiled body"))
|
||||
assertEquals(ObjTrue, scope.eval("inList(2, [1,2,3])"))
|
||||
assertEquals(ObjFalse, scope.eval("inList(5, [1,2,3])"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testFilterBug() = runTest {
|
||||
eval(
|
||||
|
||||
Reference in new issue
Block a user