Exemplo n.º 1
0
 @Test
 public void shouldPushTokenAtBegining() {
   Token pushedToken = new Token("push", 1, 0);
   List<Token> pushedTokenList = new ArrayList<>();
   pushedTokenList.add(pushedToken);
   tokenQueue.pushForward(pushedTokenList);
   assertThat(tokenQueue.peek(), is(pushedToken));
   assertThat(tokenQueue.size(), is(4));
 }
Exemplo n.º 2
0
 @Test
 public void shouldPollToken() {
   Token token = tokenQueue.poll();
   assertThat(token, is(new Token("a", 1, 0)));
   assertThat(tokenQueue.size(), is(2));
 }
Exemplo n.º 3
0
 @Test
 public void shouldPeekToken() {
   Token token = tokenQueue.peek();
   assertThat(token, is(new Token("a", 1, 0)));
   assertThat(tokenQueue.size(), is(3));
 }