Fix Lexer tests losing reference
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
eb57a46b0b
commit
831dbe6917
|
@ -8,14 +8,16 @@ TEST_CASE( "When at end of script return terminator", "[lexer]" ) {
|
|||
}
|
||||
|
||||
TEST_CASE( "Peek doesn't advance", "[lexer]" ) {
|
||||
Lexer lexer = Lexer("5 + 5", nullptr);
|
||||
auto script = "5 + 5";
|
||||
Lexer lexer = Lexer(script, nullptr);
|
||||
REQUIRE(lexer.Peek() == '5');
|
||||
REQUIRE(lexer.Peek() == '5');
|
||||
REQUIRE(lexer.Peek() == '5');
|
||||
}
|
||||
|
||||
TEST_CASE( "Next does advance", "[lexer]" ) {
|
||||
Lexer lexer = Lexer("5 + 5", nullptr);
|
||||
auto script = "5 + 5";
|
||||
Lexer lexer = Lexer(script, nullptr);
|
||||
REQUIRE(lexer.Next() == '5');
|
||||
REQUIRE(lexer.Next() == ' ');
|
||||
REQUIRE(lexer.Next() == '+');
|
||||
|
|
Loading…
Reference in New Issue