Write test helper for testing lexer