Modify test for KT-1515 to actually test using javaClass in another package as stated in the request.
NOTE: not 100% that this test actually covers the corresponding fix by Alex Tkachman.
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
package otherpackage
|
||||||
|
|
||||||
|
fun fromOtherPackage(): Boolean {
|
||||||
|
val c = javaClass<Runnable>()
|
||||||
|
return (c.getName()!! == "java.lang.Runnable")
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package thispackage
|
||||||
|
|
||||||
|
import otherpackage.*
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
if (!localUse()) {
|
||||||
|
return "local use failed"
|
||||||
|
}
|
||||||
|
if (!fromOtherPackage()) {
|
||||||
|
return "use from other package failed"
|
||||||
|
}
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun localUse(): Boolean {
|
||||||
|
val c = javaClass<Runnable>()
|
||||||
|
return (c.getName()!! == "java.lang.Runnable")
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
fun box(): String {
|
|
||||||
val c = javaClass<Runnable>()
|
|
||||||
return if(c.getName()!! == "java.lang.Runnable") "OK" else "fail"
|
|
||||||
}
|
|
||||||
@@ -22,7 +22,7 @@ public class MultiFileGenTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimple() {
|
public void testSimple() {
|
||||||
@@ -41,4 +41,8 @@ public class MultiFileGenTest extends CodegenTestCase {
|
|||||||
public void testSameNames() {
|
public void testSameNames() {
|
||||||
blackBoxMultiFile("/multi/same/1/box.kt", "/multi/same/2/box.kt");
|
blackBoxMultiFile("/multi/same/1/box.kt", "/multi/same/2/box.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testKt1515() {
|
||||||
|
blackBoxMultiFile("/multi/kt1515/thisPackage.kt", "/multi/kt1515/otherPackage.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,10 +147,6 @@ public class StdlibTest extends CodegenTestCase {
|
|||||||
blackBoxFile("regressions/kt1568.kt");
|
blackBoxFile("regressions/kt1568.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1515() throws Exception {
|
|
||||||
blackBoxFile("regressions/kt1515.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testKt1592 () throws MalformedURLException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
|
public void testKt1592 () throws MalformedURLException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
|
||||||
loadFile("regressions/kt1592.kt");
|
loadFile("regressions/kt1592.kt");
|
||||||
ClassFileFactory codegens = generateClassesInFile();
|
ClassFileFactory codegens = generateClassesInFile();
|
||||||
|
|||||||
Reference in New Issue
Block a user