Scripting: improve reporting on cyclic dependency

#KT-48177 fixed
the issue is in fact fixed by the previous commit (report error
on duplicated import) by normalizing import path before processing,
but here we're making error reporting nicer for the case.
This commit is contained in:
Ilya Chernikov
2021-08-17 17:25:47 +02:00
committed by TeamCityServer
parent c204d7a86f
commit e60e80f19a
7 changed files with 86 additions and 51 deletions
@@ -127,6 +127,12 @@ class MainKtsTest {
assertFailed("Duplicate imports:", res)
}
@Test
fun testCyclicImportError() {
val res = evalFile(File("$TEST_DATA_ROOT/import-cycle-1.main.kts"))
assertFailed("Unable to handle recursive script dependencies", res)
}
@Test
fun testCompilerOptions() {
@@ -0,0 +1,4 @@
@file:Import("import-cycle-2.main.kts")
1
@@ -0,0 +1,4 @@
@file:Import("import-cycle-1.main.kts")
2