Search in sources :

Example 1 with MandatoryChild

use of org.eclipse.xtext.ide.tests.testlanguage.partialSerializationTestLanguage.MandatoryChild in project xtext-core by eclipse.

the class PartialSerializerTest method testMandatoryChildChange.

@Test
public void testMandatoryChildChange() {
    ITextRegionAccess diff = recordDiff(MandatoryChild.class, "#4 foo", (MandatoryChild it) -> {
        MandatoryValue newMandatoryValue = fac.createMandatoryValue();
        newMandatoryValue.setName("baz");
        it.setChild(newMandatoryValue);
    });
    String expectation = "0 0   H\n" + "      B MandatoryChild       Model\n" + "0 2    S \"#4\"                 Model:'#4'\n" + "2 1 1  H \" \"                  Whitespace:TerminalRule'WS'\n" + "       B MandatoryValue'baz'  MandatoryValue path:MandatoryChild/child\n" + "3 3 1   S \"baz\"                MandatoryValue:name=ID\n" + "       E MandatoryValue'baz'  MandatoryValue path:MandatoryChild/child\n" + "      E MandatoryChild       Model\n" + "6 0 1 H\n" + "------------ diff 1 ------------\n" + "2 1  H \" \"                  Whitespace:TerminalRule'WS'\n" + "3 3  S \"foo\"                MandatoryValue:name=ID\n" + "6 0  H\n";
    changeSerializerTestHelper.operator_tripleEquals(diff, expectation);
}
Also used : ITextRegionAccess(org.eclipse.xtext.formatting2.regionaccess.ITextRegionAccess) MandatoryValue(org.eclipse.xtext.ide.tests.testlanguage.partialSerializationTestLanguage.MandatoryValue) MandatoryChild(org.eclipse.xtext.ide.tests.testlanguage.partialSerializationTestLanguage.MandatoryChild) Test(org.junit.Test)

Aggregations

ITextRegionAccess (org.eclipse.xtext.formatting2.regionaccess.ITextRegionAccess)1 MandatoryChild (org.eclipse.xtext.ide.tests.testlanguage.partialSerializationTestLanguage.MandatoryChild)1 MandatoryValue (org.eclipse.xtext.ide.tests.testlanguage.partialSerializationTestLanguage.MandatoryValue)1 Test (org.junit.Test)1