Completion: more tests for keyword escaping

This commit is contained in:
Valentin Kipyatkov
2014-08-28 17:18:12 +04:00
parent ed5c5426e6
commit c79204a41d
8 changed files with 69 additions and 0 deletions
@@ -0,0 +1,7 @@
package test
fun `fun`(){}
fun foo() {
<caret>
}
@@ -0,0 +1,7 @@
package test
fun `fun`(){}
fun foo() {
`fun`()<caret>
}
@@ -0,0 +1,13 @@
package `package`
class `class` {
class object {
val `val` = `class`()
}
}
fun foo(){
val v: `class`= <caret>
}
// ELEMENT: class.val
@@ -0,0 +1,13 @@
package `package`
class `class` {
class object {
val `val` = `class`()
}
}
fun foo(){
val v: `class`= `class`.`val`<caret>
}
// ELEMENT: class.val
@@ -0,0 +1,9 @@
class `class`<T>
trait `trait`
fun foo(p: `class`<`trait`>){}
fun f(){
foo(<caret>)
}
@@ -0,0 +1,9 @@
class `class`<T>
trait `trait`
fun foo(p: `class`<`trait`>){}
fun f(){
foo(`class`<`trait`>())<caret>
}
@@ -149,4 +149,5 @@ public class BasicCompletionHandlerTest : CompletionHandlerTestBase(){
fun testTypeArgOfSuper() = doTest(1, "X", null, '\n')
fun testKeywordClassName() = doTest(1, "class", null, '\n')
fun testKeywordFunctionName() = doTest(1, "fun", "fun()", null, '\n')
}
@@ -98,6 +98,11 @@ public class SmartCompletionHandlerTestGenerated extends AbstractSmartCompletion
doTest("idea/testData/completion/handlers/smart/ClassInObject.kt");
}
@TestMetadata("ClassObjectFieldKeywordName.kt")
public void testClassObjectFieldKeywordName() throws Exception {
doTest("idea/testData/completion/handlers/smart/ClassObjectFieldKeywordName.kt");
}
@TestMetadata("ClassObjectMethod1.kt")
public void testClassObjectMethod1() throws Exception {
doTest("idea/testData/completion/handlers/smart/ClassObjectMethod1.kt");
@@ -218,6 +223,11 @@ public class SmartCompletionHandlerTestGenerated extends AbstractSmartCompletion
doTest("idea/testData/completion/handlers/smart/ConstructorInsertsImport2.kt");
}
@TestMetadata("ConstructorWithKeywordName.kt")
public void testConstructorWithKeywordName() throws Exception {
doTest("idea/testData/completion/handlers/smart/ConstructorWithKeywordName.kt");
}
@TestMetadata("ConstructorWithLambdaParameter1.kt")
public void testConstructorWithLambdaParameter1() throws Exception {
doTest("idea/testData/completion/handlers/smart/ConstructorWithLambdaParameter1.kt");