[Test] TestGen: Use canonical class names for generated imports

This is needed to have correct class names for inner/nested classes. For example, to have `import java.util.AbstractMap.SimpleEntry` instead of `import java.util.AbstractMap$SimpleEntry`.
This commit is contained in:
Dmitriy Dolovov
2021-12-13 18:12:29 +03:00
parent c1c94778ce
commit 60dcafcf43
2 changed files with 2 additions and 2 deletions
@@ -127,7 +127,7 @@ private class TestGeneratorImplInstance(
val realName = when (clazz) {
TransformingTestMethodModel.TransformerFunctionsClassPlaceHolder::class.java ->
"org.jetbrains.kotlin.test.utils.TransformersFunctions"
else -> clazz.name
else -> clazz.canonicalName
}
p.println("import $realName;")
}
@@ -132,7 +132,7 @@ object NewTestGeneratorImpl : TestGenerator(METHOD_GENERATORS) {
val realName = when (clazz) {
TransformingTestMethodModel.TransformerFunctionsClassPlaceHolder::class.java ->
"org.jetbrains.kotlin.test.utils.TransformersFunctions"
else -> clazz.name
else -> clazz.canonicalName
}
p.println("import $realName;")
}