forked from fwcd/kotlin-language-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DefinitionTest.kt
28 lines (21 loc) · 911 Bytes
/
DefinitionTest.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package org.javacs.kt
import org.hamcrest.Matchers.*
import org.junit.Assert.assertThat
import org.junit.Before
import org.junit.Test
class DefinitionTest: LanguageServerTestFixture("definition") {
val file = "GoFrom.kt"
@Before fun `open GoFrom`() {
open(file)
}
@Test fun `go to a definition in the same file`() {
val definitions = languageServer.textDocumentService.definition(textDocumentPosition(file, 3, 24)).get()
assertThat(definitions, hasSize(1))
assertThat(definitions, hasItem(hasProperty("uri", containsString("GoFrom.kt"))))
}
@Test fun `go to a definition in a different file`() {
val definitions = languageServer.textDocumentService.definition(textDocumentPosition(file, 4, 24)).get()
assertThat(definitions, hasSize(1))
assertThat(definitions, hasItem(hasProperty("uri", containsString("GoTo.kt"))))
}
}