From 9a034cb556fa2bdc5d78f8cdf13b6620f7877fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Thu, 9 Jun 2016 23:21:05 +0200 Subject: [PATCH] Testing goal for Storage problem. --- tests/TestPDDLParser.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/TestPDDLParser.cpp b/tests/TestPDDLParser.cpp index cc8554f..e58a372 100644 --- a/tests/TestPDDLParser.cpp +++ b/tests/TestPDDLParser.cpp @@ -293,7 +293,17 @@ TEST(PDDLParserTests, ParseStorageProblem) ASSERT_NE(fact90.type(), nullptr); ASSERT_EQ(fact90.type()->name(), "hoist"); - // TODO: check goal + // Goal + const auto &goal = dynamic_cast(problem.goal()); + + ASSERT_EQ(goal.arguments().size(), 1u); + const auto &goal0 = *dynamic_cast(goal.arguments()[0].get()); + ASSERT_EQ(goal0.name(), "in"); + ASSERT_EQ(goal0.arguments().size(), 2u); + const auto &goal00 = *dynamic_cast *>(goal0.arguments()[0].get())->value(); + ASSERT_EQ(goal00.name(), "crate0"); + const auto &goal01 = *dynamic_cast *>(goal0.arguments()[1].get())->value(); + ASSERT_EQ(goal01.name(), "depot0"); } ////////////////////////////////////////////////////////////////////////////////////////////////////