Refactor lexer test