Hello, i'm trying to implement a test for a class Lexer which is defined like this
class Lexer {
public:
Lexer(std::string program);
SyntaxToken lex();
private:
char current();
char peekNext();
char lookAhead(int offset);
void advance();
int index = 0;
std::string program;
unsigned int row = 0;
};
but it has a default constructor that accepts a std::string program.
So in the method
TEST_F(LexerTest, LexerInit)
{
}
what should I do?
I saw this post on stackoverflow https://stackoverflow.com/questions/38207346/specify-constructor-arguments-for-a-google-test-fixture but it deosn't seem great. Do I have to override all the Lexer's methods? Copy and paste other methods?