Add regression test (disabled) for 'relaxed indent context' feature

Suspending work on this for now, to be resumed later.
This commit is contained in:
Kris De Volder
2017-03-08 11:21:08 -08:00
parent 71152eaeb6
commit 8c752ebdbd
2 changed files with 50 additions and 0 deletions

View File

@@ -252,6 +252,21 @@ public class Editor {
assertEquals(expect.toString(), actual.toString());
}
public void assertCompletionLabels(String... expectedLabels) throws Exception {
StringBuilder expect = new StringBuilder();
StringBuilder actual = new StringBuilder();
for (String label : expectedLabels) {
expect.append(label);
expect.append("\n");
}
for (CompletionItem completion : getCompletions()) {
actual.append(completion.getLabel());
actual.append("\n");
}
assertEquals(expect.toString(), actual.toString());
}
public void assertContainsCompletions(String... expectTextAfter) throws Exception {
StringBuilder actual = new StringBuilder();

View File

@@ -21,6 +21,7 @@ import java.util.stream.Collectors;
import org.eclipse.lsp4j.Diagnostic;
import org.eclipse.lsp4j.DiagnosticSeverity;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.ide.vscode.commons.languageserver.LanguageIds;
import org.springframework.ide.vscode.commons.util.IOUtil;
@@ -2490,6 +2491,40 @@ public class ConcourseEditorTest {
editor.assertCompletions(/*NONE*/);
}
@Ignore @Test public void relaxedIndentContextMoreSpaces() throws Exception {
Editor editor;
editor = harness.newEditor(
"resources:\n" +
"- name: foo\n" +
" type: git\n" +
" source:\n" +
" <*>"
);
editor.assertCompletionLabels(
//For the 'exact' context:
"check_every",
"name",
"source",
"type",
//For the nested context:
"branch",
"commit_verification_key_ids",
"commit_verification_keys",
"disable_ci_skip",
"git_config",
"gpg_keyserver",
"ignore_paths",
"password",
"paths",
"private_key",
"skip_ssl_verification",
"tag_filter",
"uri",
"username"
);
}
//////////////////////////////////////////////////////////////////////////////
private void assertContextualCompletions(String conText, String textBefore, String... textAfter) throws Exception {