Extended unit test on “either” types.

This commit is contained in:
Patrick Lühne 2017-06-16 04:25:42 +02:00
parent 1876d1fe0b
commit 9fbe0db567
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -32,9 +32,12 @@ TEST_CASE("[PDDL parser] The official PDDL instances are parsed correctly", "[PD
REQUIRE(predicates[0]->parameters.size() == 2);
REQUIRE(predicates[0]->parameters[0]->name == "x");
REQUIRE(predicates[0]->parameters[0]->type);
CHECK(predicates[0]->parameters[0]->type.value().is<pddl::ast::EitherPointer<pddl::ast::PrimitiveTypePointer>>());
REQUIRE(predicates[0]->parameters[0]->type.value().is<pddl::ast::EitherPointer<pddl::ast::PrimitiveTypePointer>>());
CHECK(predicates[0]->parameters[0]->type.value().get<pddl::ast::EitherPointer<pddl::ast::PrimitiveTypePointer>>()->arguments[0]->declaration->name == "person");
CHECK(predicates[0]->parameters[0]->type.value().get<pddl::ast::EitherPointer<pddl::ast::PrimitiveTypePointer>>()->arguments[1]->declaration->name == "aircraft");
REQUIRE(predicates[0]->parameters[1]->name == "c");
REQUIRE(predicates[0]->parameters[1]->type);
CHECK(predicates[0]->parameters[1]->type.value().is<pddl::ast::PrimitiveTypePointer>());
REQUIRE(predicates[0]->parameters[1]->type.value().is<pddl::ast::PrimitiveTypePointer>());
CHECK(predicates[0]->parameters[1]->type.value().get<pddl::ast::PrimitiveTypePointer>()->declaration->name == "city");
}
}