Add regression test (disabled) for 'relaxed indent context' feature
Suspending work on this for now, to be resumed later.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user