From 22e62c5723d4e18b85cdf9d42a21bc1c70fe405c Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Wed, 3 Oct 2012 23:08:50 +0400 Subject: [PATCH] KT-1973 added tests. #KT-1973 Fixed --- compiler/testData/loadKotlin/class/NamedObject.kt | 6 ++++++ compiler/testData/loadKotlin/class/NamedObject.txt | 8 ++++++++ .../class/NamedObjectWithAnotherTopLevelProperty.kt | 8 ++++++++ .../class/NamedObjectWithAnotherTopLevelProperty.txt | 9 +++++++++ .../jvm/compiler/LoadCompiledKotlinTestGenerated.java | 10 ++++++++++ .../LazyResolveNamespaceComparingTestGenerated.java | 10 ++++++++++ 6 files changed, 51 insertions(+) create mode 100644 compiler/testData/loadKotlin/class/NamedObject.kt create mode 100644 compiler/testData/loadKotlin/class/NamedObject.txt create mode 100644 compiler/testData/loadKotlin/class/NamedObjectWithAnotherTopLevelProperty.kt create mode 100644 compiler/testData/loadKotlin/class/NamedObjectWithAnotherTopLevelProperty.txt diff --git a/compiler/testData/loadKotlin/class/NamedObject.kt b/compiler/testData/loadKotlin/class/NamedObject.kt new file mode 100644 index 00000000000..1048ee28d72 --- /dev/null +++ b/compiler/testData/loadKotlin/class/NamedObject.kt @@ -0,0 +1,6 @@ +package test + +public object Obj { + public val v: String = "val" + public fun f(): String = "fun" +} \ No newline at end of file diff --git a/compiler/testData/loadKotlin/class/NamedObject.txt b/compiler/testData/loadKotlin/class/NamedObject.txt new file mode 100644 index 00000000000..5c1afa390a3 --- /dev/null +++ b/compiler/testData/loadKotlin/class/NamedObject.txt @@ -0,0 +1,8 @@ +namespace test + +public final object test.Obj : jet.Any { + private final /*constructor*/ fun (): test.Obj + public final fun f(): jet.String + public final val v: jet.String +} +public final val Obj: test.Obj diff --git a/compiler/testData/loadKotlin/class/NamedObjectWithAnotherTopLevelProperty.kt b/compiler/testData/loadKotlin/class/NamedObjectWithAnotherTopLevelProperty.kt new file mode 100644 index 00000000000..122b13c7cde --- /dev/null +++ b/compiler/testData/loadKotlin/class/NamedObjectWithAnotherTopLevelProperty.kt @@ -0,0 +1,8 @@ +package test + +public object Obj { + public val v: String = "val" + public fun f(): String = "fun" +} + +val x = 5 \ No newline at end of file diff --git a/compiler/testData/loadKotlin/class/NamedObjectWithAnotherTopLevelProperty.txt b/compiler/testData/loadKotlin/class/NamedObjectWithAnotherTopLevelProperty.txt new file mode 100644 index 00000000000..8989872944c --- /dev/null +++ b/compiler/testData/loadKotlin/class/NamedObjectWithAnotherTopLevelProperty.txt @@ -0,0 +1,9 @@ +namespace test + +public final object test.Obj : jet.Any { + private final /*constructor*/ fun (): test.Obj + public final fun f(): jet.String + public final val v: jet.String +} +public final val Obj: test.Obj +internal final val x: jet.Int diff --git a/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java b/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java index 52a7909b740..332429d0003 100644 --- a/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java @@ -135,6 +135,16 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT doTest("compiler/testData/loadKotlin/class/InnerClassExtendInnerClass.kt"); } + @TestMetadata("NamedObject.kt") + public void testNamedObject() throws Exception { + doTest("compiler/testData/loadKotlin/class/NamedObject.kt"); + } + + @TestMetadata("NamedObjectWithAnotherTopLevelProperty.kt") + public void testNamedObjectWithAnotherTopLevelProperty() throws Exception { + doTest("compiler/testData/loadKotlin/class/NamedObjectWithAnotherTopLevelProperty.kt"); + } + @TestMetadata("Trait.kt") public void testTrait() throws Exception { doTest("compiler/testData/loadKotlin/class/Trait.kt"); diff --git a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java index 2c56667888d..bc746023412 100644 --- a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java @@ -137,6 +137,16 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso doTestSinglePackage("compiler/testData/loadKotlin/class/InnerClassExtendInnerClass.kt"); } + @TestMetadata("NamedObject.kt") + public void testNamedObject() throws Exception { + doTestSinglePackage("compiler/testData/loadKotlin/class/NamedObject.kt"); + } + + @TestMetadata("NamedObjectWithAnotherTopLevelProperty.kt") + public void testNamedObjectWithAnotherTopLevelProperty() throws Exception { + doTestSinglePackage("compiler/testData/loadKotlin/class/NamedObjectWithAnotherTopLevelProperty.kt"); + } + @TestMetadata("Trait.kt") public void testTrait() throws Exception { doTestSinglePackage("compiler/testData/loadKotlin/class/Trait.kt");