Testing Parser position with seek and advance.

This commit is contained in:
Patrick Lühne 2016-06-22 09:07:19 +01:00
parent b5e325cbee
commit d9578b6f1c

View File

@ -178,6 +178,17 @@ TEST(UtilsTests, ParserPosition)
ASSERT_EQ(p.position(), startPosition);
ASSERT_FALSE(p.atEndOfStream());
for (size_t i = 0; i < 5; i++)
p.advance();
ASSERT_EQ(p.position(), static_cast<std::istream::pos_type>(5));
p.seek(static_cast<std::istream::pos_type>(7));
ASSERT_EQ(p.position(), static_cast<std::istream::pos_type>(7));
ASSERT_NO_THROW(p.expect<std::string>("test1"));
// TODO: test parser with multiple sections
}