Got rid of "namespace" word in test data.

This commit is contained in:
Evgeny Gerashchenko
2014-01-10 23:42:19 +04:00
parent ee3312fb00
commit 958f7c862d
102 changed files with 302 additions and 306 deletions
@@ -64,7 +64,7 @@ public class SpecialFiles {
excludedFiles.add("nestedInPackage.kt"); // Cannot change package name
excludedFiles.add("importNestedClass.kt"); // Cannot change package name
excludedFiles.add("namespaceQualifiedMethod.kt"); // Cannot change package name
excludedFiles.add("packageQualifiedMethod.kt"); // Cannot change package name
excludedFiles.add("classObjectToString.kt"); // Cannot change package name
excludedFiles.add("kt326.kt"); // Commented
@@ -1,5 +1,5 @@
// FILE: b.kt
package MyNamespace
package MyPackage
//properties
<!MUST_BE_INITIALIZED!>val a: Int<!>
val a1: Int = 1
@@ -31,7 +31,7 @@ fun Any?.vars(<!UNUSED_PARAMETER!>a<!>: Any?) : Int {
if (example.ns.y is Int) {
b = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>example.ns.y<!>
}
// if (namespace.bottles.ns.y is Int) {
// if (package.bottles.ns.y is Int) {
// b = ns.y
// }
if (Obj.y is Int) {
@@ -1,4 +1,4 @@
//namespace override
package override
trait T {
fun foo()
@@ -107,7 +107,7 @@ class TestBackingFieldsVisibility() {
<!INACCESSIBLE_BACKING_FIELD!>a.$a<!> = 3
}
val x = <!INACCESSIBLE_BACKING_FIELD!>$namespaceLevelVar<!>
val x = <!INACCESSIBLE_BACKING_FIELD!>$topLevelVar<!>
inner class Inner() {
val z = this@TestBackingFieldsVisibility.$x
@@ -117,7 +117,7 @@ class TestBackingFieldsVisibility() {
get() = $w //test there is no second error here
}
val namespaceLevelVar = 11
val topLevelVar = 11
class T() {
val z : Int get() = 42
@@ -1,13 +1,13 @@
// FILE: ns1.kt
// check no error in overload in different namespaces
// FILE: pkg1.kt
// check no error in overload in different packages
package ns1
package pkg1
fun e() = 1
// FILE: ns2.kt
package ns2
// FILE: pkg2.kt
package pkg2
fun e() = 1
// FILE: ns3ns1.kt
package ns3.ns1
// FILE: pkg3pkg1.kt
package pkg3.pkg1
fun e() = 1
@@ -14,7 +14,7 @@ class A() {
val x = { <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>x<!> }
}
//in a namespace
//in a package
val x = { <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>x<!> }
//KT-787 AssertionError on code 'val x = x'
@@ -1,4 +1,4 @@
JetFile: NamespaceBlockFirst.kt
JetFile: PackageBlockFirst.kt
PACKAGE_DIRECTIVE
<empty list>
PsiErrorElement:Expecting package directive or top level declaration
@@ -1,4 +1,4 @@
JetFile: NamespaceModifiers.kt
JetFile: PackageModifiers.kt
PACKAGE_DIRECTIVE
MODIFIER_LIST
PsiElement(public)('public')
+1 -1
View File
@@ -1,4 +1,4 @@
[`return`] fun `namespace`() {
[`return`] fun `package`() {
`class`()
}
+1 -1
View File
@@ -15,7 +15,7 @@ JetFile: QuotedIdentifiers.kt
PsiWhiteSpace(' ')
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('`namespace`')
PsiElement(IDENTIFIER)('`package`')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
@@ -6,7 +6,7 @@ package n {
}
abstract class XXX() {
abstract val a : Int
abstract val a1 : namespace.Int
abstract val a1 : package.Int
abstract val a2 : n.B
abstract val a3 : (A)
abstract val a31 : (n.B)
@@ -74,9 +74,7 @@ JetFile: functionTypes.kt
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('namespace')
PsiElement(package)('package')
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Int')
@@ -309,11 +309,6 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest("compiler/testData/diagnostics/tests/NamedArgumentsAndDefaultValues.kt");
}
@TestMetadata("NamespaceQualified.kt")
public void testNamespaceQualified() throws Exception {
doTest("compiler/testData/diagnostics/tests/NamespaceQualified.kt");
}
@TestMetadata("Nullability.kt")
public void testNullability() throws Exception {
doTest("compiler/testData/diagnostics/tests/Nullability.kt");
@@ -344,6 +339,11 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest("compiler/testData/diagnostics/tests/PackageInExpressionPosition.kt");
}
@TestMetadata("PackageQualified.kt")
public void testPackageQualified() throws Exception {
doTest("compiler/testData/diagnostics/tests/PackageQualified.kt");
}
@TestMetadata("PrimaryConstructors.kt")
public void testPrimaryConstructors() throws Exception {
doTest("compiler/testData/diagnostics/tests/PrimaryConstructors.kt");
@@ -404,9 +404,9 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest("compiler/testData/diagnostics/tests/SafeCallNonNullReceiverReturnNull.kt");
}
@TestMetadata("SafeCallOnFakeNamespace.kt")
public void testSafeCallOnFakeNamespace() throws Exception {
doTest("compiler/testData/diagnostics/tests/SafeCallOnFakeNamespace.kt");
@TestMetadata("SafeCallOnFakePackage.kt")
public void testSafeCallOnFakePackage() throws Exception {
doTest("compiler/testData/diagnostics/tests/SafeCallOnFakePackage.kt");
}
@TestMetadata("ShiftFunctionTypes.kt")
@@ -688,9 +688,9 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest("compiler/testData/diagnostics/tests/backingField/kt462BackingFieldsResolve.kt");
}
@TestMetadata("kt782namespaceLevel.kt")
public void testKt782namespaceLevel() throws Exception {
doTest("compiler/testData/diagnostics/tests/backingField/kt782namespaceLevel.kt");
@TestMetadata("kt782packageLevel.kt")
public void testKt782packageLevel() throws Exception {
doTest("compiler/testData/diagnostics/tests/backingField/kt782packageLevel.kt");
}
@TestMetadata("qualifiedWithThis.kt")
@@ -2652,9 +2652,9 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest("compiler/testData/diagnostics/tests/enum/classObjectOfPrivateEnum.kt");
}
@TestMetadata("dontCreateNamespaceTypeForEnumEntry.kt")
public void testDontCreateNamespaceTypeForEnumEntry() throws Exception {
doTest("compiler/testData/diagnostics/tests/enum/dontCreateNamespaceTypeForEnumEntry.kt");
@TestMetadata("dontCreatePackageTypeForEnumEntry.kt")
public void testDontCreatePackageTypeForEnumEntry() throws Exception {
doTest("compiler/testData/diagnostics/tests/enum/dontCreatePackageTypeForEnumEntry.kt");
}
@TestMetadata("entryShouldBeOfEnumType.kt")
@@ -46,9 +46,9 @@ public class TopLevelMembersInvocationTestGenerated extends AbstractTopLevelMemb
doTest("compiler/testData/codegen/topLevelMemberInvocation/functionDifferentPackage");
}
@TestMetadata("functionInMultiFileNamespace")
public void testFunctionInMultiFileNamespace() throws Exception {
doTest("compiler/testData/codegen/topLevelMemberInvocation/functionInMultiFileNamespace");
@TestMetadata("functionInMultiFilePackage")
public void testFunctionInMultiFilePackage() throws Exception {
doTest("compiler/testData/codegen/topLevelMemberInvocation/functionInMultiFilePackage");
}
@TestMetadata("functionSamePackage")
@@ -31,7 +31,7 @@ import org.jetbrains.jet.codegen.generated.AbstractBlackBoxCodegenTest;
/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("compiler/testData/codegen/box")
@InnerTestClasses({BlackBoxCodegenTestGenerated.Arrays.class, BlackBoxCodegenTestGenerated.BinaryOp.class, BlackBoxCodegenTestGenerated.Bridges.class, BlackBoxCodegenTestGenerated.BuiltinStubMethods.class, BlackBoxCodegenTestGenerated.CallableReference.class, BlackBoxCodegenTestGenerated.Casts.class, BlackBoxCodegenTestGenerated.Classes.class, BlackBoxCodegenTestGenerated.Closures.class, BlackBoxCodegenTestGenerated.Constants.class, BlackBoxCodegenTestGenerated.ControlStructures.class, BlackBoxCodegenTestGenerated.DefaultArguments.class, BlackBoxCodegenTestGenerated.DelegatedProperty.class, BlackBoxCodegenTestGenerated.Elvis.class, BlackBoxCodegenTestGenerated.Enum.class, BlackBoxCodegenTestGenerated.ExclExcl.class, BlackBoxCodegenTestGenerated.ExtensionFunctions.class, BlackBoxCodegenTestGenerated.ExtensionProperties.class, BlackBoxCodegenTestGenerated.FakeOverride.class, BlackBoxCodegenTestGenerated.FieldRename.class, BlackBoxCodegenTestGenerated.Finally.class, BlackBoxCodegenTestGenerated.Functions.class, BlackBoxCodegenTestGenerated.InnerNested.class, BlackBoxCodegenTestGenerated.Instructions.class, BlackBoxCodegenTestGenerated.Intrinsics.class, BlackBoxCodegenTestGenerated.Labels.class, BlackBoxCodegenTestGenerated.LocalClasses.class, BlackBoxCodegenTestGenerated.MultiDecl.class, BlackBoxCodegenTestGenerated.Namespace.class, BlackBoxCodegenTestGenerated.Objects.class, BlackBoxCodegenTestGenerated.OperatorConventions.class, BlackBoxCodegenTestGenerated.PrimitiveTypes.class, BlackBoxCodegenTestGenerated.Properties.class, BlackBoxCodegenTestGenerated.Reflection.class, BlackBoxCodegenTestGenerated.SafeCall.class, BlackBoxCodegenTestGenerated.SamConstructors.class, BlackBoxCodegenTestGenerated.Strings.class, BlackBoxCodegenTestGenerated.Super.class, BlackBoxCodegenTestGenerated.ToArray.class, BlackBoxCodegenTestGenerated.Traits.class, BlackBoxCodegenTestGenerated.TypeInfo.class, BlackBoxCodegenTestGenerated.TypeMapping.class, BlackBoxCodegenTestGenerated.UnaryOp.class, BlackBoxCodegenTestGenerated.Unit.class, BlackBoxCodegenTestGenerated.Vararg.class, BlackBoxCodegenTestGenerated.When.class})
@InnerTestClasses({BlackBoxCodegenTestGenerated.Arrays.class, BlackBoxCodegenTestGenerated.BinaryOp.class, BlackBoxCodegenTestGenerated.Bridges.class, BlackBoxCodegenTestGenerated.BuiltinStubMethods.class, BlackBoxCodegenTestGenerated.CallableReference.class, BlackBoxCodegenTestGenerated.Casts.class, BlackBoxCodegenTestGenerated.Classes.class, BlackBoxCodegenTestGenerated.Closures.class, BlackBoxCodegenTestGenerated.Constants.class, BlackBoxCodegenTestGenerated.ControlStructures.class, BlackBoxCodegenTestGenerated.DefaultArguments.class, BlackBoxCodegenTestGenerated.DelegatedProperty.class, BlackBoxCodegenTestGenerated.Elvis.class, BlackBoxCodegenTestGenerated.Enum.class, BlackBoxCodegenTestGenerated.ExclExcl.class, BlackBoxCodegenTestGenerated.ExtensionFunctions.class, BlackBoxCodegenTestGenerated.ExtensionProperties.class, BlackBoxCodegenTestGenerated.FakeOverride.class, BlackBoxCodegenTestGenerated.FieldRename.class, BlackBoxCodegenTestGenerated.Finally.class, BlackBoxCodegenTestGenerated.Functions.class, BlackBoxCodegenTestGenerated.InnerNested.class, BlackBoxCodegenTestGenerated.Instructions.class, BlackBoxCodegenTestGenerated.Intrinsics.class, BlackBoxCodegenTestGenerated.Labels.class, BlackBoxCodegenTestGenerated.LocalClasses.class, BlackBoxCodegenTestGenerated.MultiDecl.class, BlackBoxCodegenTestGenerated.Objects.class, BlackBoxCodegenTestGenerated.OperatorConventions.class, BlackBoxCodegenTestGenerated.Package.class, BlackBoxCodegenTestGenerated.PrimitiveTypes.class, BlackBoxCodegenTestGenerated.Properties.class, BlackBoxCodegenTestGenerated.Reflection.class, BlackBoxCodegenTestGenerated.SafeCall.class, BlackBoxCodegenTestGenerated.SamConstructors.class, BlackBoxCodegenTestGenerated.Strings.class, BlackBoxCodegenTestGenerated.Super.class, BlackBoxCodegenTestGenerated.ToArray.class, BlackBoxCodegenTestGenerated.Traits.class, BlackBoxCodegenTestGenerated.TypeInfo.class, BlackBoxCodegenTestGenerated.TypeMapping.class, BlackBoxCodegenTestGenerated.UnaryOp.class, BlackBoxCodegenTestGenerated.Unit.class, BlackBoxCodegenTestGenerated.Vararg.class, BlackBoxCodegenTestGenerated.When.class})
public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInBox() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), true);
@@ -2506,9 +2506,9 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest("compiler/testData/codegen/box/fieldRename/genericPropertyWithItself.kt");
}
@TestMetadata("inNamespace.kt")
public void testInNamespace() throws Exception {
doTest("compiler/testData/codegen/box/fieldRename/inNamespace.kt");
@TestMetadata("inPackage.kt")
public void testInPackage() throws Exception {
doTest("compiler/testData/codegen/box/fieldRename/inPackage.kt");
}
@TestMetadata("simple.kt")
@@ -3837,49 +3837,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
}
}
@TestMetadata("compiler/testData/codegen/box/namespace")
public static class Namespace extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInNamespace() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/codegen/box/namespace"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("boxPrimitiveTypeInClinit.kt")
public void testBoxPrimitiveTypeInClinit() throws Exception {
doTest("compiler/testData/codegen/box/namespace/boxPrimitiveTypeInClinit.kt");
}
@TestMetadata("checkCast.kt")
public void testCheckCast() throws Exception {
doTest("compiler/testData/codegen/box/namespace/checkCast.kt");
}
@TestMetadata("incrementProperty.kt")
public void testIncrementProperty() throws Exception {
doTest("compiler/testData/codegen/box/namespace/incrementProperty.kt");
}
@TestMetadata("invokespecial.kt")
public void testInvokespecial() throws Exception {
doTest("compiler/testData/codegen/box/namespace/invokespecial.kt");
}
@TestMetadata("namespaceQualifiedMethod.kt")
public void testNamespaceQualifiedMethod() throws Exception {
doTest("compiler/testData/codegen/box/namespace/namespaceQualifiedMethod.kt");
}
@TestMetadata("nullablePrimitiveNoFieldInitializer.kt")
public void testNullablePrimitiveNoFieldInitializer() throws Exception {
doTest("compiler/testData/codegen/box/namespace/nullablePrimitiveNoFieldInitializer.kt");
}
@TestMetadata("privateTopLevelPropAndVarInInner.kt")
public void testPrivateTopLevelPropAndVarInInner() throws Exception {
doTest("compiler/testData/codegen/box/namespace/privateTopLevelPropAndVarInInner.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/objects")
public static class Objects extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInObjects() throws Exception {
@@ -4116,6 +4073,49 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
}
}
@TestMetadata("compiler/testData/codegen/box/package")
public static class Package extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInPackage() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/codegen/box/package"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("boxPrimitiveTypeInClinit.kt")
public void testBoxPrimitiveTypeInClinit() throws Exception {
doTest("compiler/testData/codegen/box/package/boxPrimitiveTypeInClinit.kt");
}
@TestMetadata("checkCast.kt")
public void testCheckCast() throws Exception {
doTest("compiler/testData/codegen/box/package/checkCast.kt");
}
@TestMetadata("incrementProperty.kt")
public void testIncrementProperty() throws Exception {
doTest("compiler/testData/codegen/box/package/incrementProperty.kt");
}
@TestMetadata("invokespecial.kt")
public void testInvokespecial() throws Exception {
doTest("compiler/testData/codegen/box/package/invokespecial.kt");
}
@TestMetadata("nullablePrimitiveNoFieldInitializer.kt")
public void testNullablePrimitiveNoFieldInitializer() throws Exception {
doTest("compiler/testData/codegen/box/package/nullablePrimitiveNoFieldInitializer.kt");
}
@TestMetadata("packageQualifiedMethod.kt")
public void testPackageQualifiedMethod() throws Exception {
doTest("compiler/testData/codegen/box/package/packageQualifiedMethod.kt");
}
@TestMetadata("privateTopLevelPropAndVarInInner.kt")
public void testPrivateTopLevelPropAndVarInInner() throws Exception {
doTest("compiler/testData/codegen/box/package/privateTopLevelPropAndVarInInner.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/primitiveTypes")
public static class PrimitiveTypes extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInPrimitiveTypes() throws Exception {
@@ -5246,9 +5246,9 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
suite.addTestSuite(Labels.class);
suite.addTestSuite(LocalClasses.class);
suite.addTest(MultiDecl.innerSuite());
suite.addTestSuite(Namespace.class);
suite.addTestSuite(Objects.class);
suite.addTest(OperatorConventions.innerSuite());
suite.addTestSuite(Package.class);
suite.addTestSuite(PrimitiveTypes.class);
suite.addTestSuite(Properties.class);
suite.addTestSuite(Reflection.class);
@@ -267,16 +267,6 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest {
doParsingTest("compiler/testData/psi/MultiVariableDeclarations.kt");
}
@TestMetadata("NamespaceBlockFirst.kt")
public void testNamespaceBlockFirst() throws Exception {
doParsingTest("compiler/testData/psi/NamespaceBlockFirst.kt");
}
@TestMetadata("NamespaceModifiers.kt")
public void testNamespaceModifiers() throws Exception {
doParsingTest("compiler/testData/psi/NamespaceModifiers.kt");
}
@TestMetadata("NestedComments.kt")
public void testNestedComments() throws Exception {
doParsingTest("compiler/testData/psi/NestedComments.kt");
@@ -302,6 +292,16 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest {
doParsingTest("compiler/testData/psi/ObjectLiteralAsStatement.kt");
}
@TestMetadata("PackageBlockFirst.kt")
public void testPackageBlockFirst() throws Exception {
doParsingTest("compiler/testData/psi/PackageBlockFirst.kt");
}
@TestMetadata("PackageModifiers.kt")
public void testPackageModifiers() throws Exception {
doParsingTest("compiler/testData/psi/PackageModifiers.kt");
}
@TestMetadata("ParameterNameMising.kt")
public void testParameterNameMising() throws Exception {
doParsingTest("compiler/testData/psi/ParameterNameMising.kt");
@@ -82,11 +82,6 @@ public class ResolveTestGenerated extends AbstractResolveTest {
doTest("compiler/testData/resolve/LocalObjects.resolve");
}
@TestMetadata("Namespaces.resolve")
public void testNamespaces() throws Exception {
doTest("compiler/testData/resolve/Namespaces.resolve");
}
@TestMetadata("NestedObjects.resolve")
public void testNestedObjects() throws Exception {
doTest("compiler/testData/resolve/NestedObjects.resolve");
@@ -102,6 +97,11 @@ public class ResolveTestGenerated extends AbstractResolveTest {
doTest("compiler/testData/resolve/Objects.resolve");
}
@TestMetadata("Packages.resolve")
public void testPackages() throws Exception {
doTest("compiler/testData/resolve/Packages.resolve");
}
@TestMetadata("PrimaryConstructorParameters.resolve")
public void testPrimaryConstructorParameters() throws Exception {
doTest("compiler/testData/resolve/PrimaryConstructorParameters.resolve");
+22 -24
View File
@@ -118,34 +118,32 @@ enum class MyEnum() {
abstract enum class MyAbstractEnum() {}
//package MyNamespace {
//properties
<error>val a: Int</error>
val a1: Int = 1
<error><error>abstract</error> val a2: Int</error>
<error>abstract</error> val a3: Int = 1
//properties
<error>val a: Int</error>
val a1: Int = 1
<error><error>abstract</error> val a2: Int</error>
<error>abstract</error> val a3: Int = 1
<error>var b: Int</error> private set
var b1: Int = 0; private set
<error><error>abstract</error> var b2: Int</error> private set
<error>abstract</error> var b3: Int = 0; private set
<error>var b: Int</error> private set
var b1: Int = 0; private set
<error><error>abstract</error> var b2: Int</error> private set
<error>abstract</error> var b3: Int = 0; private set
<error>var c: Int</error> set(v: Int) { $c = v }
var c1: Int = 0; set(v: Int) { $c1 = v }
<error><error>abstract</error> var c2: Int</error> set(v: Int) { $c2 = v }
<error>abstract</error> var c3: Int = 0; set(v: Int) { $c3 = v }
<error>var c: Int</error> set(v: Int) { $c = v }
var c1: Int = 0; set(v: Int) { $c1 = v }
<error><error>abstract</error> var c2: Int</error> set(v: Int) { $c2 = v }
<error>abstract</error> var c3: Int = 0; set(v: Int) { $c3 = v }
val e: Int get() = a
val e1: Int = <error>0</error>; get() = a
<error>abstract</error> val e2: Int get() = a
<error>abstract</error> val e3: Int = <error>0</error>; get() = a
val e: Int get() = a
val e1: Int = <error>0</error>; get() = a
<error>abstract</error> val e2: Int get() = a
<error>abstract</error> val e3: Int = <error>0</error>; get() = a
//methods
<error>fun f()</error>
fun g() {}
<error>abstract</error> fun h()
<error>abstract</error> fun j() {}
//}
//methods
<error>fun f()</error>
fun g() {}
<error>abstract</error> fun h()
<error>abstract</error> fun j() {}
//creating an instance
abstract class B1(
@@ -3,4 +3,4 @@ package Tests
class A : java.<caret>
// EXIST: lang, util, io
// ABSENT: fun, val, var, namespace
// ABSENT: fun, val, var, package
@@ -3,7 +3,7 @@ fun foo() {
str.<caret>
}
// ABSENT: namespace, as, type, class, this, super, val, var, fun, for, null, true
// ABSENT: package, as, type, class, this, super, val, var, fun, for, null, true
// ABSENT: false, is, in, throw, return, break, continue, object, if, try, else, while
// ABSENT: do, when, trait, This
@@ -1,5 +0,0 @@
package test
fun foo() {
"" // test/TestPackage-namespaceOfPackage
}
+5
View File
@@ -0,0 +1,5 @@
package test
fun foo() {
"" // test/TestPackage-package
}
+1 -1
View File
@@ -7,5 +7,5 @@ package testing
fun <info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">testing</info>(<info textAttributesKey="KOTLIN_PARAMETER">t1</info>: <info textAttributesKey="KOTLIN_CLASS">Test</info>, <info textAttributesKey="KOTLIN_PARAMETER">t2</info>: <info textAttributesKey="KOTLIN_CLASS">Test</info>): <info textAttributesKey="KOTLIN_CLASS">Test</info> {
if (<info textAttributesKey="KOTLIN_PARAMETER">t1</info> != <info textAttributesKey="KOTLIN_PARAMETER">t2</info>) return <info textAttributesKey="KOTLIN_CLASS">Test</info>.<info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">FIRST</info>
return <info textAttributesKey="KOTLIN_NAMESPACE_FUNCTION_CALL"><info textAttributesKey="KOTLIN_FUNCTION_CALL">testing</info></info>(<info textAttributesKey="KOTLIN_CLASS">Test</info>.<info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">FIRST</info>, <info textAttributesKey="KOTLIN_CLASS">Test</info>.<info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">SECOND</info>)
return <info textAttributesKey="KOTLIN_PACKAGE_FUNCTION_CALL"><info textAttributesKey="KOTLIN_FUNCTION_CALL">testing</info></info>(<info textAttributesKey="KOTLIN_CLASS">Test</info>.<info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">FIRST</info>, <info textAttributesKey="KOTLIN_CLASS">Test</info>.<info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">SECOND</info>)
}
+2 -2
View File
@@ -10,8 +10,8 @@ fun <info textAttributesKey="KOTLIN_CLASS">Int</info>.<info textAttributesKey="K
<info textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">open</info> class <info textAttributesKey="KOTLIN_CLASS">Container</info> {
<info textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">open</info> fun <info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">member</info>() {
<info textAttributesKey="KOTLIN_NAMESPACE_FUNCTION_CALL"><info textAttributesKey="KOTLIN_FUNCTION_CALL">global</info></info>()
5.<info textAttributesKey="KOTLIN_EXTENSION_FUNCTION_CALL"><info textAttributesKey="KOTLIN_NAMESPACE_FUNCTION_CALL"><info textAttributesKey="KOTLIN_FUNCTION_CALL">ext</info></info></info>()
<info textAttributesKey="KOTLIN_PACKAGE_FUNCTION_CALL"><info textAttributesKey="KOTLIN_FUNCTION_CALL">global</info></info>()
5.<info textAttributesKey="KOTLIN_EXTENSION_FUNCTION_CALL"><info textAttributesKey="KOTLIN_PACKAGE_FUNCTION_CALL"><info textAttributesKey="KOTLIN_FUNCTION_CALL">ext</info></info></info>()
<info textAttributesKey="KOTLIN_FUNCTION_CALL">member</info>()
}
}
+4 -4
View File
@@ -1,13 +1,13 @@
var <info textAttributesKey="KOTLIN_MUTABLE_VARIABLE"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD"><info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY">x</info></info></info> = 5
var <info textAttributesKey="KOTLIN_MUTABLE_VARIABLE"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD"><info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">x</info></info></info> = 5
val <info textAttributesKey="KOTLIN_CLASS">Int</info>.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY">sq</info></info> : <info textAttributesKey="KOTLIN_CLASS">Int</info>
val <info textAttributesKey="KOTLIN_CLASS">Int</info>.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">sq</info></info> : <info textAttributesKey="KOTLIN_CLASS">Int</info>
<info textAttributesKey="KOTLIN_KEYWORD">get</info>() {
return this * this
}
val <info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD">y</info></info> : <info textAttributesKey="KOTLIN_CLASS">Int</info> = 1
val <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD">y</info></info> : <info textAttributesKey="KOTLIN_CLASS">Int</info> = 1
<info textAttributesKey="KOTLIN_KEYWORD">get</info>() {
return 5.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY">sq</info></info> + <info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY"><info textAttributesKey="KOTLIN_BACKING_FIELD_ACCESS">$y</info></info> + <info textAttributesKey="KOTLIN_MUTABLE_VARIABLE"><info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY">x</info></info>
return 5.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">sq</info></info> + <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_BACKING_FIELD_ACCESS">$y</info></info> + <info textAttributesKey="KOTLIN_MUTABLE_VARIABLE"><info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">x</info></info>
}
class <info textAttributesKey="KOTLIN_CLASS">Foo</info>(val <info textAttributesKey="KOTLIN_PARAMETER"><info textAttributesKey="KOTLIN_INSTANCE_PROPERTY"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD">a</info></info></info> : <info textAttributesKey="KOTLIN_CLASS">Int</info>, <info textAttributesKey="KOTLIN_PARAMETER">b</info> : <info textAttributesKey="KOTLIN_CLASS">String</info>) {
@@ -3,9 +3,9 @@ trait <info textAttributesKey="KOTLIN_TRAIT">FunctionLike</info> {
}
}
var <info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE">global</info></info></info> : () -> <info textAttributesKey="KOTLIN_CLASS">Unit</info> = {}
var <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_PROPERTY_WITH_BACKING_FIELD"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE">global</info></info></info> : () -> <info textAttributesKey="KOTLIN_CLASS">Unit</info> = {}
val <info textAttributesKey="KOTLIN_CLASS">Int</info>.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY">ext</info></info> : () -> <info textAttributesKey="KOTLIN_CLASS">Unit</info>
val <info textAttributesKey="KOTLIN_CLASS">Int</info>.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">ext</info></info> : () -> <info textAttributesKey="KOTLIN_CLASS">Unit</info>
<info textAttributesKey="KOTLIN_KEYWORD">get</info>() {
return {}
}
@@ -13,8 +13,8 @@ val <info textAttributesKey="KOTLIN_CLASS">Int</info>.<info textAttributesKey="K
fun <info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">foo</info>(<info textAttributesKey="KOTLIN_PARAMETER">a</info> : () -> <info textAttributesKey="KOTLIN_CLASS">Unit</info>, <info textAttributesKey="KOTLIN_PARAMETER">functionLike</info>: <info textAttributesKey="KOTLIN_TRAIT">FunctionLike</info>) {
<info textAttributesKey="KOTLIN_PARAMETER"><info textAttributesKey="KOTLIN_VARIABLE_AS_FUNCTION">a</info></info>()
<info textAttributesKey="KOTLIN_PARAMETER"><info textAttributesKey="KOTLIN_VARIABLE_AS_FUNCTION_LIKE">functionLike</info></info>()
<info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE"><info textAttributesKey="KOTLIN_VARIABLE_AS_FUNCTION">global</info></info></info>()
1.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_NAMESPACE_PROPERTY"><info textAttributesKey="KOTLIN_VARIABLE_AS_FUNCTION">ext</info></info></info>();
<info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE"><info textAttributesKey="KOTLIN_VARIABLE_AS_FUNCTION">global</info></info></info>()
1.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY"><info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_VARIABLE_AS_FUNCTION">ext</info></info></info>();
{}() //should not be highlighted as "calling variable as function"!
}
@@ -143,16 +143,6 @@ public class JetPsiCheckerTestGenerated extends AbstractJetPsiCheckerTest {
doTest("idea/testData/checker/MultipleBounds.kt");
}
@TestMetadata("NamespaceAsExpression.kt")
public void testNamespaceAsExpression() throws Exception {
doTest("idea/testData/checker/NamespaceAsExpression.kt");
}
@TestMetadata("NamespaceQualified.kt")
public void testNamespaceQualified() throws Exception {
doTest("idea/testData/checker/NamespaceQualified.kt");
}
@TestMetadata("NestedObjects.kt")
public void testNestedObjects() throws Exception {
doTest("idea/testData/checker/NestedObjects.kt");
@@ -183,6 +173,16 @@ public class JetPsiCheckerTestGenerated extends AbstractJetPsiCheckerTest {
doTest("idea/testData/checker/OverridesAndGenerics.kt");
}
@TestMetadata("PackageAsExpression.kt")
public void testPackageAsExpression() throws Exception {
doTest("idea/testData/checker/PackageAsExpression.kt");
}
@TestMetadata("PackageQualified.kt")
public void testPackageQualified() throws Exception {
doTest("idea/testData/checker/PackageQualified.kt");
}
@TestMetadata("PrimaryConstructors.kt")
public void testPrimaryConstructors() throws Exception {
doTest("idea/testData/checker/PrimaryConstructors.kt");
@@ -259,16 +259,16 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
doTest("idea/testData/completion/basic/common/InLongDotQualifiedExpression.kt");
}
@TestMetadata("InMiddleOfNamespace.kt")
public void testInMiddleOfNamespace() throws Exception {
doTest("idea/testData/completion/basic/common/InMiddleOfNamespace.kt");
}
@TestMetadata("InMiddleOfPackage.kt")
public void testInMiddleOfPackage() throws Exception {
doTest("idea/testData/completion/basic/common/InMiddleOfPackage.kt");
}
@TestMetadata("InMiddleOfPackageDirective.kt")
public void testInMiddleOfPackageDirective() throws Exception {
doTest("idea/testData/completion/basic/common/InMiddleOfPackageDirective.kt");
}
@TestMetadata("InObjectInDelegationSpecifier.kt")
public void testInObjectInDelegationSpecifier() throws Exception {
doTest("idea/testData/completion/basic/common/InObjectInDelegationSpecifier.kt");
@@ -334,9 +334,9 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
doTest("idea/testData/completion/basic/common/NoCompletionAfterLong.kt");
}
@TestMetadata("NoEmptyNamespace.kt")
public void testNoEmptyNamespace() throws Exception {
doTest("idea/testData/completion/basic/common/NoEmptyNamespace.kt");
@TestMetadata("NoEmptyPackage.kt")
public void testNoEmptyPackage() throws Exception {
doTest("idea/testData/completion/basic/common/NoEmptyPackage.kt");
}
@TestMetadata("NoObjectInTypePosition.kt")
@@ -28,7 +28,7 @@ public class JetInJavaCompletionTest extends JetCompletionMultiTestBase {
doFileTest();
}
public void testClassFromNamespace() {
public void testClassFromPackage() {
doFileTest();
}
@@ -259,16 +259,16 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
doTest("idea/testData/completion/basic/common/InLongDotQualifiedExpression.kt");
}
@TestMetadata("InMiddleOfNamespace.kt")
public void testInMiddleOfNamespace() throws Exception {
doTest("idea/testData/completion/basic/common/InMiddleOfNamespace.kt");
}
@TestMetadata("InMiddleOfPackage.kt")
public void testInMiddleOfPackage() throws Exception {
doTest("idea/testData/completion/basic/common/InMiddleOfPackage.kt");
}
@TestMetadata("InMiddleOfPackageDirective.kt")
public void testInMiddleOfPackageDirective() throws Exception {
doTest("idea/testData/completion/basic/common/InMiddleOfPackageDirective.kt");
}
@TestMetadata("InObjectInDelegationSpecifier.kt")
public void testInObjectInDelegationSpecifier() throws Exception {
doTest("idea/testData/completion/basic/common/InObjectInDelegationSpecifier.kt");
@@ -334,9 +334,9 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
doTest("idea/testData/completion/basic/common/NoCompletionAfterLong.kt");
}
@TestMetadata("NoEmptyNamespace.kt")
public void testNoEmptyNamespace() throws Exception {
doTest("idea/testData/completion/basic/common/NoEmptyNamespace.kt");
@TestMetadata("NoEmptyPackage.kt")
public void testNoEmptyPackage() throws Exception {
doTest("idea/testData/completion/basic/common/NoEmptyPackage.kt");
}
@TestMetadata("NoObjectInTypePosition.kt")
@@ -59,7 +59,7 @@ public class JetPositionManagerTest extends PositionManagerTestCase {
return positionManager;
}
public void testMultiFileNamespace() {
public void testMultiFilePackage() {
doMultiTest();
}
@@ -99,7 +99,7 @@ public class JetPositionManagerTest extends PositionManagerTestCase {
doTest();
}
public void testNamespaceOfPackage() {
public void testPackage() {
doTest();
}
@@ -29,13 +29,13 @@ public final class KotlinLibTest extends SingleFileTranslationTest {
super("kotlinLib/");
}
public void testNamespaceHasDeclaredFunction() throws Exception {
runJavascriptTest("namespace.js");
public void testPackageHasDeclaredFunction() throws Exception {
runJavascriptTest("package.js");
}
public void testNamespaceHasDeclaredClasses() throws Exception {
runJavascriptTest("namespaceWithClasses.js");
public void testPackageHasDeclaredClasses() throws Exception {
runJavascriptTest("packageWithClasses.js");
}
@@ -41,8 +41,8 @@ public final class MiscTest extends AbstractExpressionTest {
fooBoxTest();
}
public void testClassWithoutNamespace() throws Exception {
runFunctionOutputTest("classWithoutNamespace.kt", Namer.getRootPackageName(), "box", true);
public void testClassWithoutPackage() throws Exception {
runFunctionOutputTest("classWithoutPackage.kt", Namer.getRootPackageName(), "box", true);
}
public void testIfElseAsExpressionWithThrow() throws Exception {
@@ -103,15 +103,15 @@ public final class MiscTest extends AbstractExpressionTest {
fooBoxTest();
}
public void testNamespacePropertyCalledAsFun() throws Exception {
public void testPackagePropertyCalledAsFun() throws Exception {
fooBoxTest();
}
public void testExtensionLiteralCreatedAtNamespaceLevel() throws Exception {
public void testExtensionLiteralCreatedAtPackageLevel() throws Exception {
fooBoxTest();
}
public void testTemporaryVariableCreatedInNamespaceInitializer() throws Exception {
public void testTemporaryVariableCreatedInPackageInitializer() throws Exception {
fooBoxTest();
}
@@ -131,8 +131,8 @@ public final class MiscTest extends AbstractExpressionTest {
checkFooBoxIsTrue("KT-1865.kt");
}
public void testMainFunInNestedNamespace() throws Exception {
checkOutput("mainFunInNestedNamespace.kt", "ayee");
public void testMainFunInNestedPackage() throws Exception {
checkOutput("mainFunInNestedPackage.kt", "ayee");
}
@@ -149,14 +149,14 @@ public final class MiscTest extends AbstractExpressionTest {
fooBoxTest();
}
public void testNamespaceLevelVarInPackage() throws Exception {
public void testPackageLevelVarInPackage() throws Exception {
fooBoxIsValue("OK");
}
//TODO: see http://youtrack.jetbrains.com/issue/KT-2564
@SuppressWarnings("UnusedDeclaration")
public void TODO_testNamespaceLevelVarInRoot() throws Exception {
runFunctionOutputTest("namespaceLevelVarInRoot.kt", Namer.getRootPackageName(), "box", "OK");
public void TODO_testPackageLevelVarInRoot() throws Exception {
runFunctionOutputTest("packageLevelVarInRoot.kt", Namer.getRootPackageName(), "box", "OK");
}
public void testLazyPropertyGetterNotCalledOnStart() throws Exception {
@@ -1,61 +0,0 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.k2js.test.semantics;
import org.jetbrains.k2js.test.MultipleFilesTranslationTest;
public class MultiNamespaceTest extends MultipleFilesTranslationTest {
public MultiNamespaceTest() {
super("multiNamespace/");
}
public void testFunctionsVisibleFromOtherNamespace() throws Exception {
checkFooBoxIsTrue("functionsVisibleFromOtherNamespace");
}
//TODO: fails on centos-1 build agent, can't reproduce
public void TODO_testClassesInheritedFromOtherNamespace() throws Exception {
checkFooBoxIsTrue("classesInheritedFromOtherNamespace");
}
public void testNamespaceVariableVisibleFromOtherNamespace() throws Exception {
checkFooBoxIsTrue("namespaceVariableVisibleFromOtherNamespace");
}
public void testNestedNamespaceFunctionCalledFromOtherNamespace() throws Exception {
runMultiFileTest("nestedNamespaceFunctionCalledFromOtherNamespace", "a.foo", "box", true);
}
public void testSubnamespacesWithClashingNames() throws Exception {
runMultiFileTest("subnamespacesWithClashingNames", "a.foo", "box", true);
}
public void testSubnamespacesWithClashingNamesUsingImport() throws Exception {
runMultiFileTest("subnamespacesWithClashingNamesUsingImport", "a.foo", "box", true);
}
public void testCreateClassFromOtherNamespace() throws Exception {
runMultiFileTest("createClassFromOtherNamespace", "a.foo", "box", true);
}
public void testCreateClassFromOtherNamespaceUsingImport() throws Exception {
runMultiFileTest("createClassFromOtherNamespaceUsingImport", "a.foo", "box", true);
}
}
@@ -0,0 +1,61 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.k2js.test.semantics;
import org.jetbrains.k2js.test.MultipleFilesTranslationTest;
public class MultiPackageTest extends MultipleFilesTranslationTest {
public MultiPackageTest() {
super("multiPackage/");
}
public void testFunctionsVisibleFromOtherPackage() throws Exception {
checkFooBoxIsTrue("functionsVisibleFromOtherPackage");
}
//TODO: fails on centos-1 build agent, can't reproduce
public void TODO_testClassesInheritedFromOtherPackage() throws Exception {
checkFooBoxIsTrue("classesInheritedFromOtherPackage");
}
public void testPackageVariableVisibleFromOtherPackage() throws Exception {
checkFooBoxIsTrue("PackageVariableVisibleFromOtherPackage");
}
public void testNestedPackageFunctionCalledFromOtherPackage() throws Exception {
runMultiFileTest("nestedPackageFunctionCalledFromOtherPackage", "a.foo", "box", true);
}
public void testSubPackagesWithClashingNames() throws Exception {
runMultiFileTest("subPackagesWithClashingNames", "a.foo", "box", true);
}
public void testSubPackagesWithClashingNamesUsingImport() throws Exception {
runMultiFileTest("subPackagesWithClashingNamesUsingImport", "a.foo", "box", true);
}
public void testCreateClassFromOtherPackage() throws Exception {
runMultiFileTest("createClassFromOtherPackage", "a.foo", "box", true);
}
public void testCreateClassFromOtherPackageUsingImport() throws Exception {
runMultiFileTest("createClassFromOtherPackageUsingImport", "a.foo", "box", true);
}
}
@@ -1,48 +0,0 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.k2js.test.semantics;
import org.jetbrains.k2js.test.SingleFileTranslationTest;
public final class NamespaceTest extends SingleFileTranslationTest {
public NamespaceTest() {
super("namespace/");
}
public void testNestedNamespace() throws Exception {
runFunctionOutputTest("nestedNamespace.kt", "foo.bar", "box", true);
}
public void testDeeplyNestedNamespace() throws Exception {
runFunctionOutputTest("deeplyNestedNamespace.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true);
}
public void testDeeplyNestedNamespaceFunctionCalled() throws Exception {
runFunctionOutputTest("deeplyNestedNamespaceFunctionCalled.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true
);
}
public void testClassCreatedInDeeplyNestedNamespace() throws Exception {
runFunctionOutputTest("classCreatedInDeeplyNestedNamespace.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true
);
}
public void testInitializersOfNestedNamespacesExecute() throws Exception {
runFunctionOutputTest("initializersOfNestedNamespacesExecute.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true
);
}
}
@@ -0,0 +1,48 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.k2js.test.semantics;
import org.jetbrains.k2js.test.SingleFileTranslationTest;
public final class PackageTest extends SingleFileTranslationTest {
public PackageTest() {
super("package/");
}
public void testNestedPackage() throws Exception {
runFunctionOutputTest("nestedPackage.kt", "foo.bar", "box", true);
}
public void testDeeplyNestedPackage() throws Exception {
runFunctionOutputTest("deeplyNestedPackage.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true);
}
public void testDeeplyNestedPackageFunctionCalled() throws Exception {
runFunctionOutputTest("deeplyNestedPackageFunctionCalled.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true
);
}
public void testClassCreatedInDeeplyNestedPackage() throws Exception {
runFunctionOutputTest("classCreatedInDeeplyNestedPackage.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true
);
}
public void testInitializersOfNestedPackagesExecute() throws Exception {
runFunctionOutputTest("initializersOfNestedPackagesExecute.kt", "foo1.foo2.foo3.foo5.foo6.foo7.foo8", "box", true
);
}
}
@@ -56,21 +56,21 @@ public final class PropertyAccessTest extends SingleFileTranslationTest {
fooBoxTest();
}
public void testNamespacePropertyInitializer() throws Exception {
public void testPackagePropertyInitializer() throws Exception {
fooBoxTest();
}
public void testNamespacePropertySet() throws Exception {
public void testPackagePropertySet() throws Exception {
fooBoxTest();
}
public void testNamespaceCustomAccessors() throws Exception {
public void testPackageCustomAccessors() throws Exception {
fooBoxTest();
}
public void testClassUsesNamespaceProperties() throws Exception {
public void testClassUsesPackageProperties() throws Exception {
fooBoxTest();
}
@@ -6,7 +6,7 @@ import kotlin.io.*
* Represents a generic API to templates which should be usable
* in JavaScript in a browser or on the server side stand alone or in a web app etc.
*
* To make things easier to implement in JS this namespace won't refer to any java.io or servlet
* To make things easier to implement in JS this package won't refer to any java.io or servlet
* stuff
*/
trait Template {
@@ -247,7 +247,7 @@ class KModel(val context: BindingContext, val config: KDocConfig, val sourceDirs
if (packageFragment != null) {
allPackageFragments.add(packageFragment);
} else {
warning("No NamespaceDescriptor for source $source")
warning("No PackageFragmentDescriptor for source $source")
}
}
val allClasses = HashSet<KClass>()
@@ -847,7 +847,7 @@ class TemplateLinkRenderer(val annotated: KAnnotated, val template: KDocTemplate
protected fun findWritableScope(declarationDescriptor: DeclarationDescriptor) : WritableScopeImpl? {
val container = declarationDescriptor.getContainingDeclaration()
if (container is NamespaceDescriptor) {
if (container is PackageFragmentDescriptor) {
val scope = container.getMemberScope()
if (scope is WritableScopeImpl) {
return scope

Some files were not shown because too many files have changed in this diff Show More