Sanitize names for script class files
Use the same process that is done for package parts in the JVM back-end, except adding the "Kt" suffix #KT-15225 Fixed
This commit is contained in:
@@ -90,6 +90,13 @@ class ScriptGenTest : CodegenTestCase() {
|
||||
assertEquals(239, invoke as Int / 2)
|
||||
}
|
||||
|
||||
fun testNameSanitation() {
|
||||
setUpEnvironment("scriptCustom/1#@2.kts")
|
||||
|
||||
val aClass = generateClass("_1__2")
|
||||
assertEquals("OK", aClass.getDeclaredMethod("getResult")(aClass.newInstance()))
|
||||
}
|
||||
|
||||
private fun setUpEnvironment(sourcePath: String) {
|
||||
setUpEnvironment(listOf(sourcePath))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user