Search in sources :

Example 46 with Model

use of com.microsoft.z3.Model in project xtext-core by eclipse.

the class Bug250313Test method testSTRINGConversion_05.

@Test
public void testSTRINGConversion_05() throws Exception {
    Model model = (Model) getModel("2+ 'str'");
    assertEquals("[str]", model.getMultiValue().toString());
    assertEquals("org.eclipse.xtext.common.Terminals.STRING", lexerRule);
    assertTrue(node instanceof ILeafNode);
    assertEquals("'str'", string);
    assertEquals(1, convertCallCount);
}
Also used : ILeafNode(org.eclipse.xtext.nodemodel.ILeafNode) Model(org.eclipse.xtext.valueconverter.bug250313.Model) Test(org.junit.Test)

Example 47 with Model

use of com.microsoft.z3.Model in project xtext-core by eclipse.

the class Bug250313Test method testNestedDatatypeConversion_08.

@Test
public void testNestedDatatypeConversion_08() throws Exception {
    Model model = (Model) getModel("1+ zonk +");
    assertEquals("[str]", model.getMultiValue().toString());
    assertEquals("org.eclipse.xtext.valueconverter.Bug250313.NestedDatatype", lexerRule);
    assertTrue(node instanceof ICompositeNode);
    assertEquals(4, Iterables.size(((ICompositeNode) node).getChildren()));
    assertEquals("zonk +", string);
    assertEquals(1, convertCallCount);
}
Also used : Model(org.eclipse.xtext.valueconverter.bug250313.Model) ICompositeNode(org.eclipse.xtext.nodemodel.ICompositeNode) Test(org.junit.Test)

Example 48 with Model

use of com.microsoft.z3.Model in project xtext-core by eclipse.

the class Bug250313Test method testDatatypeConversion_02.

@Test
public void testDatatypeConversion_02() throws Exception {
    Model model = (Model) getModel("foo - bar");
    assertEquals("str", model.getValue());
    assertEquals("org.eclipse.xtext.valueconverter.Bug250313.Datatype", lexerRule);
    assertTrue(node instanceof ICompositeNode);
    assertEquals(5, Iterables.size(((ICompositeNode) node).getChildren()));
    assertEquals("foo - bar", string);
    assertEquals(1, convertCallCount);
}
Also used : Model(org.eclipse.xtext.valueconverter.bug250313.Model) ICompositeNode(org.eclipse.xtext.nodemodel.ICompositeNode) Test(org.junit.Test)

Example 49 with Model

use of com.microsoft.z3.Model in project xtext-core by eclipse.

the class Bug250313Test method testSTRINGConversion_01.

@Test
public void testSTRINGConversion_01() throws Exception {
    Model model = (Model) getModel("1 'str'");
    assertEquals("str", model.getValue());
    assertNotNull(lexerRule);
    assertEquals("org.eclipse.xtext.common.Terminals.STRING", lexerRule);
    assertTrue(node instanceof ILeafNode);
    assertEquals("'str'", string);
    assertEquals(1, convertCallCount);
}
Also used : ILeafNode(org.eclipse.xtext.nodemodel.ILeafNode) Model(org.eclipse.xtext.valueconverter.bug250313.Model) Test(org.junit.Test)

Example 50 with Model

use of com.microsoft.z3.Model in project xtext-core by eclipse.

the class Bug250313Test method testNestedDatatypeConversion_06.

@Test
public void testNestedDatatypeConversion_06() throws Exception {
    Model model = (Model) getModel("4 zonk +");
    assertEquals("str", model.getValue());
    assertEquals("org.eclipse.xtext.valueconverter.Bug250313.NestedDatatype", lexerRule);
    assertTrue(node instanceof ICompositeNode);
    assertEquals(4, Iterables.size(((ICompositeNode) node).getChildren()));
    assertEquals("zonk +", string);
    assertEquals(1, convertCallCount);
}
Also used : Model(org.eclipse.xtext.valueconverter.bug250313.Model) ICompositeNode(org.eclipse.xtext.nodemodel.ICompositeNode) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)45 Model (org.eclipse.xtext.valueconverter.bug250313.Model)30 ICompositeNode (org.eclipse.xtext.nodemodel.ICompositeNode)16 BoolExpr (com.microsoft.z3.BoolExpr)11 ILeafNode (org.eclipse.xtext.nodemodel.ILeafNode)11 Model (org.eclipse.xtext.parsetree.reconstr.bug299395.Model)9 SubModel (org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel)9 Model (com.microsoft.z3.Model)7 Init (dartagnan.program.Init)7 Program (dartagnan.program.Program)7 Set (java.util.Set)7 Collectors (java.util.stream.Collectors)7 com.microsoft.z3 (com.microsoft.z3)6 Event (dartagnan.program.Event)6 Load (dartagnan.program.Load)6 Location (dartagnan.program.Location)6 MemEvent (dartagnan.program.MemEvent)6 Register (dartagnan.program.Register)6 Store (dartagnan.program.Store)6 EPackage (org.eclipse.emf.ecore.EPackage)6