Delete three diagnostic tests which rendered parts of JRE

- PackageLocalClassNotImportedWithDefaultImport.kt goes to codegen multi-file
  tests. File in java.lang moved to kotlin.jvm, which seems irrelevant to the
  test, because java.lang is prohibited by the VM
- MergePackagesWithJava.kt (KT-689, Java and Kotlin in the same package) and
  kt955.kt (Unable to import from default package) are considered too obsolete
  to even test and are thus deleted

Also check that there's no more than 1000 lines in the .txt file in diagnostic
tests.
This commit is contained in:
Alexander Udalov
2015-04-10 19:16:27 +03:00
parent 94df191f86
commit 92fa107471
12 changed files with 29 additions and 48238 deletions
@@ -0,0 +1,10 @@
package a
import pack.*
class X : SomeClass()
fun box(): String {
X()
return "OK"
}
@@ -0,0 +1,3 @@
package kotlin.jvm
private class SomeClass
@@ -0,0 +1,3 @@
package pack
public open class SomeClass
@@ -1,8 +0,0 @@
// KT-689 Allow to put Java and Kotlin files in the same packages
// This is a stub test. One should not extend Java packages that come from libraries.
package java
val c : java.lang.Class<*>? = null
val <T> Array<T>?.length : Int get() = if (this != null) <!DEBUG_INFO_SMARTCAST!>this<!>.size() else throw NullPointerException()
File diff suppressed because it is too large Load Diff
@@ -1,16 +0,0 @@
// FILE: File1.kt
package java.lang
private class SomeClass
// FILE: File2.kt
package pack
public open class SomeClass
// FILE: Main.kt
package a
import pack.*
class X : SomeClass()
@@ -1,24 +0,0 @@
//FILE:a.kt
//KT-955 Unable to import a Kotlin package into a Kotlin file with no package header
package foo
fun f() {}
//FILE:b.kt
import foo.*
val m = f() // unresolved
//FILE:c.kt
package java.util
fun bar() {}
//FILE:d.kt
import java.util.*
val r = bar()
File diff suppressed because it is too large Load Diff
@@ -20,6 +20,7 @@ import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Sets;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiElement;
import kotlin.Function1;
import kotlin.KotlinPackage;
@@ -261,6 +262,12 @@ public abstract class AbstractJetDiagnosticsTest extends BaseDiagnosticsTest {
}
}
int lineCount = StringUtil.getLineBreakCount(rootPackageText);
assert lineCount < 1000 :
"Rendered descriptors of this test take up " + lineCount + " lines. " +
"Please ensure you don't render JRE contents to the .txt file. " +
"Such tests are hard to maintain, take long time to execute and are subject to sudden unreviewed changes anyway.";
JetTestUtils.assertEqualsToFile(expectedFile, rootPackageText.toString());
}
@@ -295,12 +295,6 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("MergePackagesWithJava.kt")
public void testMergePackagesWithJava() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/MergePackagesWithJava.kt");
doTest(fileName);
}
@TestMetadata("MultilineStringTemplates.kt")
public void testMultilineStringTemplates() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/MultilineStringTemplates.kt");
@@ -5280,12 +5274,6 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("PackageLocalClassNotImportedWithDefaultImport.kt")
public void testPackageLocalClassNotImportedWithDefaultImport() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/imports/PackageLocalClassNotImportedWithDefaultImport.kt");
doTest(fileName);
}
@TestMetadata("PackageLocalClassReferencedError.kt")
public void testPackageLocalClassReferencedError() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/imports/PackageLocalClassReferencedError.kt");
@@ -10380,12 +10368,6 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("kt955.kt")
public void testKt955() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/kt955.kt");
doTest(fileName);
}
@TestMetadata("NoAmbiguityBetweenRootAndPackage.kt")
public void testNoAmbiguityBetweenRootAndPackage() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/NoAmbiguityBetweenRootAndPackage.kt");
@@ -83,6 +83,12 @@ public class BlackBoxMultiFileCodegenTestGenerated extends AbstractBlackBoxCodeg
doTestMultiFile(fileName);
}
@TestMetadata("packageLocalClassNotImportedWithDefaultImport")
public void testPackageLocalClassNotImportedWithDefaultImport() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxMultiFile/packageLocalClassNotImportedWithDefaultImport/");
doTestMultiFile(fileName);
}
@TestMetadata("samWrappersDifferentFiles")
public void testSamWrappersDifferentFiles() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxMultiFile/samWrappersDifferentFiles/");