Skip to content

Commit 63b64e4

Browse files
committed
Kotlin: Test tweaks for the diags consistency query
1 parent caf7ebc commit 63b64e4

File tree

29 files changed

+129
-9
lines changed

29 files changed

+129
-9
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11

22
annotation class SomeAnnotation
33

4+
// Diagnostic Matches: Incomplete annotation: @kotlin.Metadata(%)
5+
// Diagnostic Matches: Unknown location for kotlin.Metadata

java/ql/test/kotlin/library-tests/annotations/jvmName/test.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,12 @@ class X {
1515

1616
annotation class Ann(
1717
val p: Int,
18-
@get:JvmName("w") val q: Int)
18+
@get:JvmName("w") val q: Int)
19+
20+
// Diagnostic Matches: Incomplete annotation: @kotlin.Metadata(%)
21+
// Diagnostic Matches: Incomplete annotation: @kotlin.jvm.JvmName(name="changeY")
22+
// Diagnostic Matches: Incomplete annotation: @kotlin.jvm.JvmName(name="getX_prop")
23+
// Diagnostic Matches: Incomplete annotation: @kotlin.jvm.JvmName(name="method")
24+
// Diagnostic Matches: Incomplete annotation: @kotlin.jvm.JvmName(name="y")
25+
// Diagnostic Matches: Unknown location for kotlin.Metadata
26+
// Diagnostic Matches: Unknown location for kotlin.jvm.JvmName

java/ql/test/kotlin/library-tests/arrays-with-variances/takesArrayList.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,8 @@ public class TakesArrayList {
110110
fun inInArrayComparableAny(c: Comparable<Array<in Array<in Any>>>) { }
111111

112112
}
113+
114+
// Diagnostic Matches: Incomplete annotation: @kotlin.Metadata(%)
115+
// Diagnostic Matches: Unknown location for kotlin.Metadata
116+
// Diagnostic Matches: Completion failure for type: org.jetbrains.annotations.NotNull
117+
// Diagnostic Matches: Unknown location for org.jetbrains.annotations.NotNull

java/ql/test/kotlin/library-tests/comments/comments.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ comments
1515
| comments.kt:71:9:73:11 | /**\n * An anonymous function comment\n */ | /**\n * An anonymous function comment\n */ |
1616
| comments.kt:79:9:81:11 | /**\n * A local function comment\n */ | /**\n * A local function comment\n */ |
1717
| comments.kt:88:10:90:11 | /**\n * An anonymous object comment\n */ | /**\n * An anonymous object comment\n */ |
18+
| comments.kt:95:1:95:163 | // Diagnostic Matches: % Couldn't get owner of KDoc. The comment is extracted without an owner. ...while extracting a file (comments.kt) at %comments.kt:1:1:96:0% | // Diagnostic Matches: % Couldn't get owner of KDoc. The comment is extracted without an owner. ...while extracting a file (comments.kt) at %comments.kt:1:1:96:0% |
1819
commentOwners
1920
| comments.kt:4:1:11:3 | /**\n * A group of *members*.\n *\n * This class has no useful logic; it's just a documentation example.\n *\n * @property name the name of this group.\n * @constructor Creates an empty group.\n */ | comments.kt:12:1:31:1 | Group |
2021
| comments.kt:4:1:11:3 | /**\n * A group of *members*.\n *\n * This class has no useful logic; it's just a documentation example.\n *\n * @property name the name of this group.\n * @constructor Creates an empty group.\n */ | comments.kt:12:1:31:1 | Group |
@@ -39,6 +40,7 @@ commentNoOwners
3940
| comments.kt:1:1:1:25 | /** Kdoc with no owner */ |
4041
| comments.kt:24:9:24:25 | // A line comment |
4142
| comments.kt:28:5:30:6 | /*\n A block comment\n */ |
43+
| comments.kt:95:1:95:163 | // Diagnostic Matches: % Couldn't get owner of KDoc. The comment is extracted without an owner. ...while extracting a file (comments.kt) at %comments.kt:1:1:96:0% |
4244
commentSections
4345
| comments.kt:1:1:1:25 | /** Kdoc with no owner */ | Kdoc with no owner |
4446
| comments.kt:4:1:11:3 | /**\n * A group of *members*.\n *\n * This class has no useful logic; it's just a documentation example.\n *\n * @property name the name of this group.\n * @constructor Creates an empty group.\n */ | A group of *members*.\n\nThis class has no useful logic; it's just a documentation example.\n\n |

java/ql/test/kotlin/library-tests/comments/comments.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,6 @@ class XX {
9090
*/
9191
X() {
9292
}
93-
}
93+
}
94+
95+
// Diagnostic Matches: % Couldn't get owner of KDoc. The comment is extracted without an owner. ...while extracting a file (comments.kt) at %comments.kt:1:1:96:0%

java/ql/test/kotlin/library-tests/controlflow/basic/Test.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,5 @@ fun fn_when(x: Boolean, y: Boolean) {
122122
else -> false
123123
} -> { } }
124124
}
125+
126+
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Int.dec in java.lang.Integer ...while extracting a call (<no name>) at %Test.kt:40:4:40:6%

java/ql/test/kotlin/library-tests/controlflow/dominance/Test.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,5 @@ TODO
9898
}
9999

100100
}
101+
102+
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Int.dec in java.lang.Integer ...while extracting a call (<no name>) at %Test.kt:40:4:40:6%

java/ql/test/kotlin/library-tests/controlflow/dominance/Test2.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ public class Test2 {
3535
}
3636
}
3737
}
38+
39+
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Int.dec in java.lang.Integer ...while extracting a call (<no name>) at %Test2.kt:34:4:34:6%

java/ql/test/kotlin/library-tests/dataflow/func/kotlinx_coroutines_stubs.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public fun <T> CoroutineScope.async(
3030
block: suspend CoroutineScope.() -> T
3131
): Deferred<T> {
3232
return null!!
33-
}
33+
}
34+
35+
// Diagnostic Matches: % Couldn't get owner of KDoc. The comment is extracted without an owner. ...while extracting a file (kotlinx_coroutines_stubs.kt) at %kotlinx_coroutines_stubs.kt:1:1:36:0%

java/ql/test/kotlin/library-tests/exprs/exprs.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,3 +338,15 @@ fun unaryExprs(i: Int, d: Double, b: Byte, s: Short, l: Long, f: Float) {
338338
+f
339339
-f
340340
}
341+
342+
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Byte.dec in java.lang.Byte %
343+
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Byte.inc in java.lang.Byte %
344+
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Byte.toInt in java.lang.Byte %
345+
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Int.dec in java.lang.Integer %
346+
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Int.inc in java.lang.Integer %
347+
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Int.rangeTo in java.lang.Integer %
348+
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Short.inc in java.lang.Short %
349+
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Short.dec in java.lang.Short %
350+
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Short.toInt in java.lang.Short %
351+
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Long.dec in java.lang.Long %
352+
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Long.inc in java.lang.Long %

0 commit comments

Comments
 (0)