Improve the error reporting for the lexer tests

This commit is contained in:
Ben Gruver 2011-10-09 22:52:56 -04:00
parent 94e5a39ad2
commit 2829262f9d

View File

@ -185,8 +185,8 @@ public class LexerTest {
int expectedTokenType = tokenTypesByName.get(expectedToken.tokenName);
if (token.getType() != expectedTokenType) {
Assert.fail(String.format("Invalid token at index %d. Expecting %s, got %s",
expectedTokenIndex-1, expectedToken.tokenName, getTokenName(token.getType())));
Assert.fail(String.format("Invalid token at index %d. Expecting %s, got %s(%s)",
expectedTokenIndex-1, expectedToken.tokenName, getTokenName(token.getType()), token.getText()));
}
if (expectedToken.tokenText != null) {