Esempio n. 1
0
 @Test
 public void testMatch() {
   assertEquals(0, TokenType.START.match("Foo", 0));
   assertEquals(-1, TokenType.START.match("Foo", 1));
   assertEquals(1, TokenType.NUMBER_INT.match("1+3", 0));
   assertEquals(4, TokenType.NUMBER_INT.match("1234+3", 0));
   assertEquals(3, TokenType.END.match("1+3", 3));
   assertEquals(-1, TokenType.END.match("1+3", 2));
 }
Esempio n. 2
0
 @Test
 public void testGetFollowers() {
   assertTrue(TokenType.END.getFollowers().isEmpty());
   assertFalse(TokenType.START.getFollowers().isEmpty());
 }