patrick
/
plasp
Archived
1
0
Fork 0

Testing Parser’s reset method.

This commit is contained in:
Patrick Lühne 2016-06-22 09:02:46 +01:00
parent 234938349c
commit b5e325cbee
1 changed files with 6 additions and 0 deletions

View File

@ -91,6 +91,8 @@ TEST(UtilsTests, ParserPosition)
std::stringstream s("123 \n4\ntest1\n test2\ntest3 \ntest4\n\n\n\n");
plasp::utils::Parser p("input", s);
const auto startPosition = p.position();
plasp::utils::Parser::Coordinate c;
c = p.coordinate();
@ -172,6 +174,10 @@ TEST(UtilsTests, ParserPosition)
ASSERT_EQ(c.column, 1u);
ASSERT_TRUE(p.atEndOfStream());
p.reset();
ASSERT_EQ(p.position(), startPosition);
ASSERT_FALSE(p.atEndOfStream());
// TODO: test parser with multiple sections
}