File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
server/src/test/kotlin/org/javacs/kt Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package org.javacs.kt
2
2
3
3
import java.util.concurrent.CancellationException
4
4
import org.eclipse.lsp4j.Diagnostic
5
+ import org.eclipse.lsp4j.DiagnosticSeverity
5
6
import org.eclipse.lsp4j.DocumentSymbolParams
6
7
import org.eclipse.lsp4j.PublishDiagnosticsParams
7
8
import org.eclipse.lsp4j.TextDocumentIdentifier
@@ -10,10 +11,12 @@ import org.junit.Assert.assertThat
10
11
import org.junit.Test
11
12
12
13
class DiagnosticTest : SingleFileTestFixture (" diagnostic" , " Diagnostics.kt" ) {
13
- @Test fun `report error on open` () {
14
+ @Test fun `report diagnostics on open` () {
14
15
languageServer.textDocumentService.debounceLint.waitForPendingTask()
15
16
16
- assertThat(diagnostics, not (empty<Diagnostic >()))
17
+ assertThat(diagnostics, hasSize(2 ))
18
+ assertThat(diagnostics.filter { it.severity == DiagnosticSeverity .Warning }, hasSize(1 ))
19
+ assertThat(diagnostics.filter { it.severity == DiagnosticSeverity .Error }, hasSize(1 ))
17
20
}
18
21
19
22
@Test fun `only lint once for many edits in a short period` () {
You can’t perform that action at this time.
0 commit comments