From b5e325cbeeb327a470ee86a41f1b0553ae951e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Wed, 22 Jun 2016 09:02:46 +0100 Subject: [PATCH] =?UTF-8?q?Testing=20Parser=E2=80=99s=20reset=20method.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/TestUtils.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/TestUtils.cpp b/tests/TestUtils.cpp index 7f5fbba..e95b92e 100644 --- a/tests/TestUtils.cpp +++ b/tests/TestUtils.cpp @@ -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 }