assertLexesSingleToken(" 1\t\n \t", NUMBER);
assertLexesMultipleTokens(" [ 1 , null\t\n ]\t", OPEN_BRACKET, NUMBER, COMMA, NULL, CLOSE_BRACKET);
}
private void assertLexesMultipleTokens(String json, Token... tokens) {
JsonLexer lexer = new JsonLexer(json);
for (Token token : tokens) {
assertTrue("Expected "+token, lexer.moveNext());
assertEquals(token, lexer.getToken());
}
assertFalse(lexer.moveNext());
}