use of org.eclipse.xtext.parser.impl.DatatypeRuleToken in project xtext-core by eclipse.
the class AntlrDatatypeRuleTokenTest method testConstructor.
@Test
public void testConstructor() {
DatatypeRuleToken token = new AntlrDatatypeRuleToken();
assertNull(token.getText());
assertEquals(DatatypeRuleToken.INITIAL_OFFSET, token.getStartOffset());
assertEquals(DatatypeRuleToken.INITIAL_OFFSET, token.getExpectedOffset());
assertEquals("AntlrDatatypeRuleToken{\n\tstartOffset: -1\n\texpectedOffset: -1\n\tbufferValue: ''\n}", token.toString());
}
use of org.eclipse.xtext.parser.impl.DatatypeRuleToken in project xtext-core by eclipse.
the class AntlrDatatypeRuleTokenTest method testSetText.
@Test
public void testSetText() {
DatatypeRuleToken token = new AntlrDatatypeRuleToken();
token.setText("text");
assertEquals("text", token.getText());
token.setText("longerText");
assertEquals("longerText", token.getText());
token.setText("text");
assertEquals("text", token.getText());
token.setText("");
assertNull(token.getText());
}
Aggregations