use of org.eclipse.xtext.ide.tests.testlanguage.partialSerializationTestLanguage.TwoChilds in project xtext-core by eclipse.
the class ChangeSerializerTest method testMoveElement_3.
@Test
public void testMoveElement_3() {
InMemoryURIHandler fs = new InMemoryURIHandler();
String content = "#24 direct:\n" + " child:jumper\n";
changeSerializerTestHelper.operator_add(fs, Pair.of("inmemory:/file-move3.pstl", content));
ResourceSet rs = changeSerializerTestHelper.createResourceSet(fs);
TwoChilds model = changeSerializerTestHelper.findFirstOfTypeInFile(rs, "inmemory:/file-move3.pstl", TwoChilds.class);
IChangeSerializer serializer = changeSerializerTestHelper.newChangeSerializer();
serializer.addModification(model.eResource(), (Resource it) -> {
model.setDirectChild(model.getOptChild().getChild());
});
Collection<IEmfResourceChange> changes = changeSerializerTestHelper.endRecordChangesToTextDocuments(serializer);
String expectation = "-------------- inmemory:/file-move3.pstl (syntax: <offset|text>) ---------------\n" + "<0:26|#24 direct:\n" + " jumper\n" + "child :>\n" + "--------------------------------------------------------------------------------\n" + "0 26 \"#24 direct:\\n" + " chil...\" -> \"#24 direct:\\n" + " jump...\"\n";
changeSerializerTestHelper.operator_tripleEquals(changes, expectation);
}
Aggregations