Test that fails with package prefixes but works good without them

This commit is contained in:
Nikolay Krasko
2015-11-09 22:32:39 +03:00
parent 03310491d0
commit 33fd247bde
5 changed files with 52 additions and 1 deletions
@@ -228,7 +228,7 @@ public class KotlinJpsBuildTest : AbstractKotlinJpsBuildTestCase() {
public fun testSourcePackagePrefix() {
doTest()
}
public fun testSourcePackageLongPrefix() {
initProject()
val buildResult = makeAll()
@@ -238,6 +238,14 @@ public class KotlinJpsBuildTest : AbstractKotlinJpsBuildTestCase() {
assertEquals("Invalid package prefix name is ignored: invalid-prefix.test", warnings.first().messageText)
}
public fun testSourcePackagePrefixKnownIssueWithInnerClasses() {
initProject()
val buildResult = makeAll()
buildResult.assertFailed()
val errors = buildResult.getMessages(BuildMessage.Kind.ERROR).map { it.messageText }
assertTrue("Message wasn't found. $errors", errors.first().contains("class xxx.JavaWithInner.TextRenderer, unresolved supertypes: TableRow"))
}
public fun testKotlinJavaScriptProject() {
initProject()
addKotlinJavaScriptStdlibDependency()
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="xxx"/>
</content>
<orderEntry type="jdk" jdkName="IDEA_JDK" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="kotlinProject" />
</component>
</module>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
</component>
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/kotlinProject.iml" filepath="$PROJECT_DIR$/kotlinProject.iml" />
</modules>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="IDEA_JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
@@ -0,0 +1,14 @@
package xxx;
import xxx.JavaWithInner.TableRenderer.TableRow;
public class JavaWithInner {
public static class TableRenderer{
public interface TableRow {
}
}
public static class TextRenderer implements TableRow {
public void method() {}
}
}
@@ -0,0 +1,3 @@
package xxx
val test = JavaWithInner.TextRenderer().method()