diff --git a/tests/TestPDDLParser.cpp b/tests/TestPDDLParser.cpp index 254390b..cc8554f 100644 --- a/tests/TestPDDLParser.cpp +++ b/tests/TestPDDLParser.cpp @@ -136,7 +136,24 @@ TEST(PDDLParserTests, ParseBlocksWorldProblem) ASSERT_EQ(fact8.name(), "handempty"); ASSERT_EQ(fact8.arguments().size(), 0u); - // TODO: check goal + // Goal + const auto &goal = dynamic_cast(problem.goal()); + + ASSERT_EQ(goal.arguments().size(), 3u); + const auto &goal0 = *dynamic_cast(goal.arguments()[0].get()); + ASSERT_EQ(goal0.name(), "on"); + ASSERT_EQ(goal0.arguments().size(), 2u); + const auto &goal00 = *dynamic_cast *>(goal0.arguments()[0].get())->value(); + ASSERT_EQ(goal00.name(), "d"); + const auto &goal01 = *dynamic_cast *>(goal0.arguments()[1].get())->value(); + ASSERT_EQ(goal01.name(), "c"); + const auto &goal2 = *dynamic_cast(goal.arguments()[2].get()); + ASSERT_EQ(goal2.name(), "on"); + ASSERT_EQ(goal2.arguments().size(), 2u); + const auto &goal20 = *dynamic_cast *>(goal2.arguments()[0].get())->value(); + ASSERT_EQ(goal20.name(), "b"); + const auto &goal21 = *dynamic_cast *>(goal2.arguments()[1].get())->value(); + ASSERT_EQ(goal21.name(), "a"); } ////////////////////////////////////////////////////////////////////////////////////////////////////