Test find usages behaviour when failing to text search on Groovy files

Set test directory to directory with test files (not relative to
findUsages folder). This way test will be configured as if all testdata
is under source root (previously it was copied into package under path
with findUsages) and resolvers will see classes under root package.

 #KT-14974 In Progress
This commit is contained in:
Nikolay Krasko
2017-04-13 20:07:03 +03:00
parent e1de0b9cd8
commit 6e3016284a
16 changed files with 86 additions and 34 deletions
@@ -1,8 +1,8 @@
import org.jetbrains.annotations.PropertyKey
private val BUNDLE_NAME = "idea.testData.findUsages.propertyFiles.propertyFileUsages.0"
private val BUNDLE_NAME = "propertyFileUsages.0"
public fun message(@PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyFileUsages.0") key: String) = key
public fun message(@PropertyKey(resourceBundle = "propertyFileUsages.0") key: String) = key
public fun message2(@PropertyKey(resourceBundle = BUNDLE_NAME) key: String) = key
fun test() {
@@ -1,2 +1,2 @@
Usage in string constants 3 private val BUNDLE_NAME = "idea.testData.findUsages.propertyFiles.propertyFileUsages.0"
Usage in string constants 5 public fun message(@PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyFileUsages.0") key: String) = key
Usage in string constants 3 private val BUNDLE_NAME = "propertyFileUsages.0"
Usage in string constants 5 public fun message(@PropertyKey(resourceBundle = "propertyFileUsages.0") key: String) = key
+8 -8
View File
@@ -1,20 +1,20 @@
import org.jetbrains.annotations.PropertyKey
public fun message(@PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") key: String) = key
public fun message(@PropertyKey(resourceBundle = "propertyUsages.0") key: String) = key
public fun String.infixMessage(@PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") key: String) = key
public fun String.infixMessage(@PropertyKey(resourceBundle = "propertyUsages.0") key: String) = key
public fun @receiver:PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") String.infixMessage2(s: String) = this
public fun @receiver:PropertyKey(resourceBundle = "propertyUsages.0") String.infixMessage2(s: String) = this
public fun @receiver:PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") String.unaryMinus() = this
public fun @receiver:PropertyKey(resourceBundle = "propertyUsages.0") String.unaryMinus() = this
public fun Int.get(@PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") key: String) = this
public fun Int.get(@PropertyKey(resourceBundle = "propertyUsages.0") key: String) = this
public fun @receiver:PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") String.get(s: String) = this
public fun @receiver:PropertyKey(resourceBundle = "propertyUsages.0") String.get(s: String) = this
fun test() {
@PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") val s1 = "foo.bar"
@PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") val s2 = "foo.baz"
@PropertyKey(resourceBundle = "propertyUsages.0") val s1 = "foo.bar"
@PropertyKey(resourceBundle = "propertyUsages.0") val s2 = "foo.baz"
message("foo.bar")
message("foo.baz")
@@ -1,7 +1,7 @@
class A {
void test() {
@PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") String s1 = "foo.bar"
@PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") String s2 = "foo.baz"
@PropertyKey(resourceBundle = "propertyUsages.0") String s1 = "foo.bar"
@PropertyKey(resourceBundle = "propertyUsages.0") String s2 = "foo.baz"
PropertyUsages_1Kt.message("foo.bar");
PropertyUsages_1Kt.message("foo.baz");
}
@@ -1,4 +1,4 @@
[propertyUsages.1.kt] Usage in string constants 16 @PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") val s1 = "foo.bar"
[propertyUsages.1.kt] Usage in string constants 16 @PropertyKey(resourceBundle = "propertyUsages.0") val s1 = "foo.bar"
[propertyUsages.1.kt] Usage in string constants 18 message("foo.bar")
[propertyUsages.1.kt] Usage in string constants 21 "test" infixMessage "foo.bar"
[propertyUsages.1.kt] Usage in string constants 23 "foo.bar" infixMessage2 "test"
@@ -6,5 +6,5 @@
[propertyUsages.1.kt] Usage in string constants 26 -"foo.bar"
[propertyUsages.1.kt] Usage in string constants 27 1["foo.bar"]
[propertyUsages.1.kt] Usage in string constants 28 "foo.bar"["test"]
[propertyUsages.2.java] Usage in string constants 3 @PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") String s1 = "foo.bar"
[propertyUsages.2.java] Usage in string constants 5 PropertyUsages_1Kt.message("foo.bar");
[propertyUsages.2.java] Usage in string constants 3 @PropertyKey(resourceBundle = "propertyUsages.0") String s1 = "foo.bar"
[propertyUsages.2.java] Usage in string constants 5 PropertyUsages_1Kt.message("foo.bar");