summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2018-09-21 18:06:48 -0700
committerGeorge Fraser <george@fivetran.com>2018-09-21 18:06:48 -0700
commita87c19fbb3a9548dcabc3f37f71c347f7474900d (patch)
treeb4a855c90df411b4a393f6191693911f062f4396 /src/test
parentf091ea7a8bad7b9a3be5889ba895bcb45f2e6407 (diff)
downloadjava-language-server-a87c19fbb3a9548dcabc3f37f71c347f7474900d.zip
Complete class
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/javacs/CompletionsTest.java10
-rw-r--r--src/test/test-project/workspace/src/org/javacs/example/AutocompleteClassName.java1
2 files changed, 10 insertions, 1 deletions
diff --git a/src/test/java/org/javacs/CompletionsTest.java b/src/test/java/org/javacs/CompletionsTest.java
index 3f70c0b..0d5757e 100644
--- a/src/test/java/org/javacs/CompletionsTest.java
+++ b/src/test/java/org/javacs/CompletionsTest.java
@@ -759,6 +759,14 @@ public class CompletionsTest extends CompletionsBase {
var file = "/org/javacs/example/AutocompletePackageName.java";
var suggestions = insertText(file, 1, 5);
- assertThat(suggestions, contains("package org.javacs.example;\n\n"));
+ assertThat(suggestions, hasItem(startsWith("package org.javacs.example;")));
+ }
+
+ @Test
+ public void className() throws IOException {
+ var file = "/org/javacs/example/AutocompleteClassName.java";
+ var suggestions = insertText(file, 1, 2);
+
+ assertThat(suggestions, hasItem(startsWith("class AutocompleteClassName")));
}
}
diff --git a/src/test/test-project/workspace/src/org/javacs/example/AutocompleteClassName.java b/src/test/test-project/workspace/src/org/javacs/example/AutocompleteClassName.java
new file mode 100644
index 0000000..3410062
--- /dev/null
+++ b/src/test/test-project/workspace/src/org/javacs/example/AutocompleteClassName.java
@@ -0,0 +1 @@
+c \ No newline at end of file