fix #38 ImportManager integrated into Scope tree and all systems

This commit is contained in:
sergeych committed 2025-07-09 13:15:28 +03:00
1 parent ce4ed5c819
commit 26282d3e22
11 files changed
+224 -77

No files matched your search

+21 -1
View File
@@ -604,7 +604,7 @@ class ScriptTest {
}
@Test
fun testAssignArgumentsmiddleEllipsis() = runTest {
fun testAssignArgumentsMiddleEllipsis() = runTest {
val ttEnd = Token.Type.RBRACE
val pa = ArgsDeclaration(
listOf(
@@ -2440,4 +2440,24 @@ class ScriptTest {
assertEquals("foo1 / bar1", scope.eval(src).toString())
}
@Test
fun testDefaultImportManager() = runTest {
val scope = Scope()
assertFails {
scope.eval("""
import foo
foo()
""".trimIndent())
}
scope.importManager.addTextPackages("""
package foo
fun foo() { "bar" }
""".trimIndent())
scope.eval("""
import foo
assertEquals( "bar", foo())
""".trimIndent())
}
}