From a87c19fbb3a9548dcabc3f37f71c347f7474900d Mon Sep 17 00:00:00 2001 From: George Fraser Date: Fri, 21 Sep 2018 18:06:48 -0700 Subject: Complete class --- src/test/java/org/javacs/CompletionsTest.java | 10 +++++++++- .../src/org/javacs/example/AutocompleteClassName.java | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 src/test/test-project/workspace/src/org/javacs/example/AutocompleteClassName.java (limited to 'src/test') 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 -- cgit v1.2.3