use of org.eclipse.xtext.nodemodel.ICompositeNode in project xtext-core by eclipse.
the class NodeModelTest method testIgnoreEmptyLines_2.
@Test
public void testIgnoreEmptyLines_2() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("\"first\"");
_builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\"second\"");
_builder.newLine();
final ICompositeNode tree = this.getRootNode(_builder);
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("[STRING:\"first\"][-WS:");
_builder_1.newLine();
_builder_1.append("\\t");
_builder_1.newLine();
_builder_1.append("][STRING:\"second\"][-WS:");
_builder_1.newLine();
_builder_1.append("]");
_builder_1.newLine();
NodeModelTest.assertEquals(_builder_1.toString().trim(), this.asText(tree));
}
use of org.eclipse.xtext.nodemodel.ICompositeNode in project xtext-core by eclipse.
the class NodeModelTest method testIgnoreEmptyLines_7.
@Test
public void testIgnoreEmptyLines_7() {
final ICompositeNode tree = this.getRootNode("a\n\tb\n\t ");
StringConcatenation _builder = new StringConcatenation();
_builder.append("[ID:a][-WS:");
_builder.newLine();
_builder.append("\\t][INDENT:][ID:b][-WS:");
_builder.newLine();
_builder.append("\\t ][DEDENT:]");
_builder.newLine();
NodeModelTest.assertEquals(_builder.toString().trim(), this.asText(tree));
}
use of org.eclipse.xtext.nodemodel.ICompositeNode in project xtext-core by eclipse.
the class NodeModelTest method testTree_01.
@Test
public void testTree_01() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("a");
_builder.newLine();
_builder.append("\t");
_builder.append("b");
_builder.newLine();
_builder.append("\t ");
_builder.append("c");
_builder.newLine();
_builder.append("\t");
_builder.append("d");
_builder.newLine();
final ICompositeNode tree = this.getRootNode(_builder);
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("[ID:a][-WS:");
_builder_1.newLine();
_builder_1.append("\\t][INDENT:][ID:b][-WS:");
_builder_1.newLine();
_builder_1.append("\\t ][INDENT:][ID:c][-WS:");
_builder_1.newLine();
_builder_1.append("][DEDENT:][-WS:\\t][ID:d][-WS:");
_builder_1.newLine();
_builder_1.append("][DEDENT:]");
_builder_1.newLine();
NodeModelTest.assertEquals(_builder_1.toString().trim(), this.asText(tree));
}
use of org.eclipse.xtext.nodemodel.ICompositeNode in project xtext-core by eclipse.
the class NodeModelTest method testTwoRootNodes.
@Test
public void testTwoRootNodes() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("first");
_builder.newLine();
_builder.append("second");
_builder.newLine();
final ICompositeNode tree = this.getRootNode(_builder);
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("[ID:first][-WS:");
_builder_1.newLine();
_builder_1.append("][ID:second][-WS:");
_builder_1.newLine();
_builder_1.append("]");
_builder_1.newLine();
NodeModelTest.assertEquals(_builder_1.toString().trim(), this.asText(tree));
}
use of org.eclipse.xtext.nodemodel.ICompositeNode in project xtext-core by eclipse.
the class NodeModelTest method testIgnoreEmptyLines_6.
@Test
public void testIgnoreEmptyLines_6() {
final ICompositeNode tree = this.getRootNode("first\n\t\tabc\n\t\n");
StringConcatenation _builder = new StringConcatenation();
_builder.append("[ID:first][-WS:");
_builder.newLine();
_builder.append("\\t\\t][INDENT:][ID:abc][-WS:");
_builder.newLine();
_builder.append("][DEDENT:][-WS:\\t");
_builder.newLine();
_builder.append("]");
_builder.newLine();
NodeModelTest.assertEquals(_builder.toString().trim(), this.asText(tree));
}
Aggregations