Assert.assertEquals(TOK_END_OF_STREAM, token.getTokenType());
}
@Test
public void testRule8() throws ShellSyntaxException {
BjorneTokenizer tokenizer =
new BjorneTokenizer(
"if then else elif fi for done while until case { } ! do in esac a a_b a= a=b 1a=b =c");
BjorneToken token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_IF, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_THEN, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_ELSE, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_ELIF, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_FI, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_FOR, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_DONE, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_WHILE, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_UNTIL, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_CASE, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_LBRACE, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_RBRACE, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_BANG, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_DO, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_NAME, token.getTokenType()); // yes: in -> NAME
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_ESAC, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_NAME, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_NAME, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_ASSIGNMENT, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_ASSIGNMENT, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_WORD, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_WORD, token.getTokenType());
token = tokenizer.next(RULE_8_CONTEXT);
Assert.assertEquals(TOK_END_OF_STREAM, token.getTokenType());
}