#include "bnf.h" #include "cpp.h" #include "cppbnf.h" #include "lexer.h" #include "grammer.h" #include "minicc.h" #include "debug.h" #include #include "gmock/gmock.h" #include "gtest/gtest.h" #include #include #include #include #include #include #include #include class LexerTest: public ::testing::Test { protected: LexerTest(){ debug = false; } ~LexerTest() override {} }; TEST_F(LexerTest, Lex) { auto bnf{SubBNF(GetCppBNFLex(), "preprocessing-token")}; Lex::Lexer lexer(bnf, "preprocessing-token"); std::vector tokens{lexer.Lex("int main() { return 1; }")}; ASSERT_EQ(tokens.size(), 9); }