From dc2d21e0c9d0c3a5bbe1496972bc127a808e47b7 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Fri, 17 Aug 2012 18:17:12 +0400 Subject: [PATCH] test data for position manager --- idea/testData/debugger/annotation.kt | 5 + idea/testData/debugger/anonymousFunction.kt | 7 ++ idea/testData/debugger/class.kt | 9 ++ idea/testData/debugger/classObject.kt | 7 ++ idea/testData/debugger/enum.kt | 5 + idea/testData/debugger/extensionFunction.kt | 8 ++ idea/testData/debugger/innerClass.kt | 7 ++ idea/testData/debugger/localFunction.kt | 8 ++ idea/testData/debugger/namespace.kt | 3 + idea/testData/debugger/namespaceOfPackage.kt | 5 + idea/testData/debugger/objectDeclaration.kt | 7 ++ idea/testData/debugger/objectExpression.kt | 9 ++ idea/testData/debugger/propertyAccessor.kt | 4 + idea/testData/debugger/trait.kt | 5 + .../debugger/JetPositionManagerTest.java | 91 +++++++++++++++++++ 15 files changed, 180 insertions(+) create mode 100644 idea/testData/debugger/annotation.kt create mode 100644 idea/testData/debugger/anonymousFunction.kt create mode 100644 idea/testData/debugger/class.kt create mode 100644 idea/testData/debugger/classObject.kt create mode 100644 idea/testData/debugger/enum.kt create mode 100644 idea/testData/debugger/extensionFunction.kt create mode 100644 idea/testData/debugger/innerClass.kt create mode 100644 idea/testData/debugger/localFunction.kt create mode 100644 idea/testData/debugger/namespace.kt create mode 100644 idea/testData/debugger/namespaceOfPackage.kt create mode 100644 idea/testData/debugger/objectDeclaration.kt create mode 100644 idea/testData/debugger/objectExpression.kt create mode 100644 idea/testData/debugger/propertyAccessor.kt create mode 100644 idea/testData/debugger/trait.kt create mode 100644 idea/tests/org/jetbrains/jet/plugin/debugger/JetPositionManagerTest.java diff --git a/idea/testData/debugger/annotation.kt b/idea/testData/debugger/annotation.kt new file mode 100644 index 00000000000..2be7e7d2703 --- /dev/null +++ b/idea/testData/debugger/annotation.kt @@ -0,0 +1,5 @@ +annotation class A { + fun foo() { + "" // A + } +} diff --git a/idea/testData/debugger/anonymousFunction.kt b/idea/testData/debugger/anonymousFunction.kt new file mode 100644 index 00000000000..c3e6af35ce6 --- /dev/null +++ b/idea/testData/debugger/anonymousFunction.kt @@ -0,0 +1,7 @@ +class A { + fun foo() { + { + "" // A$foo$1 + }() + } +} diff --git a/idea/testData/debugger/class.kt b/idea/testData/debugger/class.kt new file mode 100644 index 00000000000..fc155e8b718 --- /dev/null +++ b/idea/testData/debugger/class.kt @@ -0,0 +1,9 @@ +class A { + val x = go() // A + + fun go() = 4 // A + + fun foo() { + "" // A + } +} diff --git a/idea/testData/debugger/classObject.kt b/idea/testData/debugger/classObject.kt new file mode 100644 index 00000000000..e91ffaf7d57 --- /dev/null +++ b/idea/testData/debugger/classObject.kt @@ -0,0 +1,7 @@ +class A { + class object { + fun foo() { + "" // A$ClassObject$ + } + } +} diff --git a/idea/testData/debugger/enum.kt b/idea/testData/debugger/enum.kt new file mode 100644 index 00000000000..7719b9b5cce --- /dev/null +++ b/idea/testData/debugger/enum.kt @@ -0,0 +1,5 @@ +enum class E { + fun foo() { + "" // E + } +} diff --git a/idea/testData/debugger/extensionFunction.kt b/idea/testData/debugger/extensionFunction.kt new file mode 100644 index 00000000000..1adeebb29f0 --- /dev/null +++ b/idea/testData/debugger/extensionFunction.kt @@ -0,0 +1,8 @@ +package a + +class A { +} + +fun A.foo() { + "" // a/namespace +} diff --git a/idea/testData/debugger/innerClass.kt b/idea/testData/debugger/innerClass.kt new file mode 100644 index 00000000000..3e0f6793b8c --- /dev/null +++ b/idea/testData/debugger/innerClass.kt @@ -0,0 +1,7 @@ +class A { + class B { + fun foo() { + "" // A$B + } + } +} diff --git a/idea/testData/debugger/localFunction.kt b/idea/testData/debugger/localFunction.kt new file mode 100644 index 00000000000..1be28360ce1 --- /dev/null +++ b/idea/testData/debugger/localFunction.kt @@ -0,0 +1,8 @@ +package test + +fun foo(): String { + fun bar(): String { + return "" // test/namespace$foo$1 + } + return bar() +} diff --git a/idea/testData/debugger/namespace.kt b/idea/testData/debugger/namespace.kt new file mode 100644 index 00000000000..c9ffe948cd3 --- /dev/null +++ b/idea/testData/debugger/namespace.kt @@ -0,0 +1,3 @@ +fun foo() { + "" // namespace +} diff --git a/idea/testData/debugger/namespaceOfPackage.kt b/idea/testData/debugger/namespaceOfPackage.kt new file mode 100644 index 00000000000..6bc14d5fc27 --- /dev/null +++ b/idea/testData/debugger/namespaceOfPackage.kt @@ -0,0 +1,5 @@ +package test + +fun foo() { + "" // test/namespace +} diff --git a/idea/testData/debugger/objectDeclaration.kt b/idea/testData/debugger/objectDeclaration.kt new file mode 100644 index 00000000000..52fdc865314 --- /dev/null +++ b/idea/testData/debugger/objectDeclaration.kt @@ -0,0 +1,7 @@ +object Obj { + val x = foo() // Obj + + fun foo(): Int { + return 0 // Obj + } +} diff --git a/idea/testData/debugger/objectExpression.kt b/idea/testData/debugger/objectExpression.kt new file mode 100644 index 00000000000..9d1e6d8f6f9 --- /dev/null +++ b/idea/testData/debugger/objectExpression.kt @@ -0,0 +1,9 @@ +class A { + fun foo() { + object { + fun bar() { + "" // A$foo$1 + } + } + } +} diff --git a/idea/testData/debugger/propertyAccessor.kt b/idea/testData/debugger/propertyAccessor.kt new file mode 100644 index 00000000000..91c9aa362fe --- /dev/null +++ b/idea/testData/debugger/propertyAccessor.kt @@ -0,0 +1,4 @@ +class A { + val foo: Int + get() = 5 // A +} diff --git a/idea/testData/debugger/trait.kt b/idea/testData/debugger/trait.kt new file mode 100644 index 00000000000..45ba749af88 --- /dev/null +++ b/idea/testData/debugger/trait.kt @@ -0,0 +1,5 @@ +trait A { + fun foo() { + "" // A$$TImpl + } +} diff --git a/idea/tests/org/jetbrains/jet/plugin/debugger/JetPositionManagerTest.java b/idea/tests/org/jetbrains/jet/plugin/debugger/JetPositionManagerTest.java new file mode 100644 index 00000000000..6f00b72152c --- /dev/null +++ b/idea/tests/org/jetbrains/jet/plugin/debugger/JetPositionManagerTest.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010-2012 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.jet.plugin.debugger; + +import com.intellij.debugger.PositionManagerFactory; +import org.jetbrains.jet.plugin.PluginTestCaseBase; + +/** + * @author udalov + */ +public class JetPositionManagerTest extends PositionManagerTestCase { + @Override + protected String getTestDataPath() { + return PluginTestCaseBase.getTestDataPathBase() + "/debugger"; + } + + @Override + protected PositionManagerFactory getPositionManagerFactory() { + return new JetPositionManagerFactory(); + } + + public void testAnnotation() { + doTest(); + } + + public void testAnonymousFunction() { + doTest(); + } + + public void testClass() { + doTest(); + } + + public void testClassObject() { + doTest(); + } + + public void testEnum() { + doTest(); + } + + public void testExtensionFunction() { + doTest(); + } + + public void testInnerClass() { + doTest(); + } + + public void testLocalFunction() { + doTest(); + } + + public void testNamespace() { + doTest(); + } + + public void testNamespaceOfPackage() { + doTest(); + } + + public void testObjectDeclaration() { + doTest(); + } + + public void testObjectExpression() { + doTest(); + } + + public void testPropertyAccessor() { + doTest(); + } + + public void testTrait() { + doTest(); + } +}