Tested KT-2718 Package names that match Kotlin keywords should be escaped properly

This commit is contained in:
Valentin Kipyatkov
2015-02-19 18:47:46 +03:00
parent 2cc291efdb
commit b0d82bef7d
8 changed files with 32 additions and 0 deletions
@@ -0,0 +1,3 @@
package foo.`val`
class `var`
+3
View File
@@ -0,0 +1,3 @@
// IMPORT: class: foo.val.var
// NAME_COUNT_TO_USE_STAR_IMPORT: 10
package p
@@ -0,0 +1,5 @@
// IMPORT: class: foo.val.var
// NAME_COUNT_TO_USE_STAR_IMPORT: 10
package p
import foo.`val`.`var`
@@ -0,0 +1,3 @@
package foo.`val`
class `var`
@@ -0,0 +1,3 @@
import foo.`val`.*
var v: `var`? = null
@@ -0,0 +1,3 @@
import foo.`val`.`var`
var v: `var`? = null
@@ -186,6 +186,12 @@ public class AddImportTestGenerated extends AbstractAddImportTest {
doTest(fileName);
}
@TestMetadata("KeywordNames.kt")
public void testKeywordNames() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/addImport/KeywordNames.kt");
doTest(fileName);
}
@TestMetadata("NameCountForStarNotReached.kt")
public void testNameCountForStarNotReached() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/addImport/NameCountForStarNotReached.kt");
@@ -111,6 +111,12 @@ public class OptimizeImportsTestGenerated extends AbstractOptimizeImportsTest {
doTest(fileName);
}
@TestMetadata("KeywordNames.kt")
public void testKeywordNames() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/editor/optimizeImports/KeywordNames.kt");
doTest(fileName);
}
@TestMetadata("KotlinPackage.kt")
public void testKotlinPackage() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/editor/optimizeImports/KotlinPackage.kt");