forked from fwcd/kotlin-language-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptTest.kt
More file actions
26 lines (21 loc) · 770 Bytes
/
Copy pathScriptTest.kt
File metadata and controls
26 lines (21 loc) · 770 Bytes
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
package org.javacs.kt
import org.hamcrest.Matchers.hasItem
import org.junit.Assert.assertThat
import org.junit.Test
class ScriptTest : LanguageServerTestFixture("script", Configuration().apply {
scripts.enabled = true
}) {
@Test fun `open script`() {
open("ExampleScript.kts")
}
}
class EditFunctionTest : SingleFileTestFixture("script", "FunctionScript.kts", Configuration().apply {
scripts.enabled = true
}) {
@Test fun `edit a function in a script`() {
replace("FunctionScript.kts", 3, 18, "2", "f")
val completions = languageServer.textDocumentService.completion(completionParams(file, 3, 19)).get().right!!
val labels = completions.items.map { it.label }
assertThat(labels, hasItem("first"))
}
}