Additional line-skipping tests for Parser.
This commit is contained in:
parent
f9c5a830e1
commit
b89b1708c3
@ -85,7 +85,7 @@ TEST(UtilsTests, ParseEndOfFile)
|
||||
|
||||
TEST(UtilsTests, ParserPosition)
|
||||
{
|
||||
std::stringstream s("123 \n4\ntest1\n test2\ntest3 \n\n\n\n\n");
|
||||
std::stringstream s("123 \n4\ntest1\n test2\ntest3 \ntest4\n\n\n\n");
|
||||
plasp::utils::Parser p(s);
|
||||
|
||||
ASSERT_EQ(p.row(), 1u);
|
||||
@ -139,6 +139,16 @@ TEST(UtilsTests, ParserPosition)
|
||||
ASSERT_EQ(p.row(), 5u);
|
||||
ASSERT_EQ(p.column(), 6u);
|
||||
|
||||
ASSERT_NO_THROW(p.skipLine());
|
||||
|
||||
ASSERT_EQ(p.row(), 6u);
|
||||
ASSERT_EQ(p.column(), 1u);
|
||||
|
||||
ASSERT_NO_THROW(p.skipLine());
|
||||
|
||||
ASSERT_EQ(p.row(), 7u);
|
||||
ASSERT_EQ(p.column(), 1u);
|
||||
|
||||
ASSERT_NO_THROW(p.skipWhiteSpace());
|
||||
|
||||
ASSERT_TRUE(p.atEndOfFile());
|
||||
|
Reference in New Issue
Block a user