Skip to content

Commit 7367a36

Browse files
committed
Update DiagnosticTest to include warnings
1 parent a41822c commit 7367a36

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

server/src/test/kotlin/org/javacs/kt/DiagnosticTest.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import org.hamcrest.Matchers.*
99
import org.junit.Assert.assertThat
1010
import org.junit.Test
1111

12-
class DiagnosticTest : SingleFileTestFixture("diagnostic", "DiagnosticErrors.kt") {
12+
class DiagnosticTest : SingleFileTestFixture("diagnostic", "Diagnostics.kt") {
1313
@Test fun `report error on open`() {
1414
languageServer.textDocumentService.debounceLint.waitForPendingTask()
1515

@@ -21,7 +21,7 @@ class DiagnosticTest : SingleFileTestFixture("diagnostic", "DiagnosticErrors.kt"
2121
for (i in 1..10) {
2222
val newText = text + "1"
2323

24-
replace(file, 3, 16, text, newText)
24+
replace(file, 7, 16, text, newText)
2525
text = newText
2626
}
2727

@@ -37,11 +37,12 @@ class DiagnosticTest : SingleFileTestFixture("diagnostic", "DiagnosticErrors.kt"
3737
languageServer.textDocumentService.lintRecompilationCallback = {
3838
if (callbackCount++ == 0) {
3939
diagnostics.clear()
40-
replace(file, 3, 9, "return 11", "")
40+
replace(file, 7, 9, "return 11", "")
4141
languageServer.textDocumentService.documentSymbol(DocumentSymbolParams(TextDocumentIdentifier(uri(file).toString()))).get()
4242
}
4343
}
44-
replace(file, 3, 16, "", "1")
44+
replace(file, 6, 9, "Foo()", "")
45+
replace(file, 7, 16, "", "1")
4546

4647
while (callbackCount < 2) {
4748
try {

server/src/test/resources/diagnostic/DiagnosticErrors.kt

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@Deprecated("")
2+
private class Foo {}
3+
4+
private class Diagnostics {
5+
fun foo() {
6+
Foo()
7+
return 1
8+
}
9+
}

0 commit comments

Comments
 (0)