package bool;

import org.junit.Test;

import java.io.IOException;

import static org.junit.Assert.assertEquals;

public class LexerTest {
    @Test
    public void test_lex() throws IOException {
        Lexer lexer = new Lexer("foo && bar");
        assertEquals(Parser.TOKEN_VAR, lexer.yylex());
        assertEquals("foo", lexer.yytext());

        assertEquals(Parser.TOKEN_AND, lexer.yylex());
        assertEquals("&&", lexer.yytext());

        assertEquals(Parser.TOKEN_VAR, lexer.yylex());
        assertEquals("bar", lexer.yytext());
    }
}

@@ -163,16 +163,23 @@
 id test_
+simple_
 lex() th
@@ -551,10 +551,1721 @@
 ;%0A    %7D%0A
+    %0A    @Test%0A    public void test_lex_or() throws IOException %7B%0A        Lexer lexer = new Lexer(%22foo %7C%7C bar%22);%0A        assertEquals(Parser.TOKEN_VAR, lexer.yylex());%0A        assertEquals(%22foo%22, lexer.yytext());%0A%0A        assertEquals(Parser.TOKEN_OR, lexer.yylex());%0A        assertEquals(%22%7C%7C%22, lexer.yytext());%0A%0A        assertEquals(Parser.TOKEN_VAR, lexer.yylex());%0A        assertEquals(%22bar%22, lexer.yytext());%0A    %7D%0A    %0A    @Test%0A    public void test_less_simple_lex() throws IOException %7B%0A    %09Lexer lexer = new Lexer(%22a && b && (!c %7C%7C !d)%22);%0A        assertEquals(Parser.TOKEN_VAR, lexer.yylex());%0A        assertEquals(%22a%22, lexer.yytext());%0A%0A        assertEquals(Parser.TOKEN_AND, lexer.yylex());%0A        assertEquals(%22&&%22, lexer.yytext());%0A%0A        assertEquals(Parser.TOKEN_VAR, lexer.yylex());%0A        assertEquals(%22b%22, lexer.yytext());%0A        %0A        assertEquals(Parser.TOKEN_AND, lexer.yylex());%0A        assertEquals(%22&&%22, lexer.yytext());%0A%0A        assertEquals(Parser.TOKEN_LPAREN, lexer.yylex());%0A        assertEquals(%22(%22, lexer.yytext());%0A        %0A        assertEquals(Parser.TOKEN_NOT, lexer.yylex());%0A        assertEquals(%22!%22, lexer.yytext());%0A        %0A        assertEquals(Parser.TOKEN_VAR, lexer.yylex());%0A        assertEquals(%22c%22, lexer.yytext());%0A        %0A        assertEquals(Parser.TOKEN_OR, lexer.yylex());%0A        assertEquals(%22%7C%7C%22, lexer.yytext());%0A        %0A        assertEquals(Parser.TOKEN_NOT, lexer.yylex());%0A        assertEquals(%22!%22, lexer.yytext());%0A        %0A        assertEquals(Parser.TOKEN_VAR, lexer.yylex());%0A        assertEquals(%22d%22, lexer.yytext());%0A        %0A        assertEquals(Parser.TOKEN_RPAREN, lexer.yylex());%0A        assertEquals(%22)%22, lexer.yytext());%0A    %7D%0A    %0A
 %7D%0A

Add a lexer test for all operators