diff --git a/lib/pddlparse/tests/TestParser.cpp b/lib/pddlparse/tests/TestParser.cpp deleted file mode 100644 index 978ed58..0000000 --- a/lib/pddlparse/tests/TestParser.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/*#include - -#include -#include - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -TEST_CASE("[parser] The Blocksworld domain is parsed correctly", "[parser]") -{ - const pddl::Context::WarningCallback ignoreWarnings = [](const auto &, const auto &){}; - - pddl::Tokenizer tokenizer; - tokenizer.read("data/blocksworld-domain.pddl"); - pddl::Context context(std::move(tokenizer), ignoreWarnings); - - const auto description = pddl::parseDescription(context); - - REQUIRE_NOTHROW(description.domain()); - - const auto &domain = description.domain(); - - // Name - CHECK(domain.name() == "blocks"); - - // Requirements - REQUIRE(domain.requirements().size() == 2u); - CHECK(domain.requirements()[0].type() == Requirement::Type::STRIPS); - CHECK(domain.requirements()[1].type() == Requirement::Type::Typing); - - // Types - REQUIRE(domain.types().size() == 1u); - - const auto &block = *domain.types()[0]; - - CHECK(block.name() == "block"); - REQUIRE(block.parentTypes().size() == 0u); - - // Predicates - REQUIRE(domain.predicates().size() == 5u); - - const auto &on = *domain.predicates()[0]; - - CHECK(on.name() == "on"); - REQUIRE(on.parameters().size() == 2u); - CHECK(on.parameters()[0]->name() == "x"); - const auto &onArgument0Type = on.parameters()[0]->type()->as(); - CHECK(&onArgument0Type == &block); - CHECK(on.parameters()[1]->name() == "y"); - const auto &onArgument1Type = on.parameters()[1]->type()->as(); - CHECK(&onArgument1Type == &block); - - const auto &handempty = *domain.predicates()[3]; - - CHECK(handempty.name() == "handempty"); - CHECK(handempty.parameters().empty()); - - // Actions - REQUIRE(domain.actions().size() == 4u); - - const auto &pickUp = *domain.actions()[0]; - - CHECK(pickUp.name() == "pick-up"); - REQUIRE(pickUp.parameters().size() == 1u); - CHECK(pickUp.parameters()[0]->name() == "x"); - CHECK(pickUp.parameters()[0]->type() == &block); - - const auto &pickUpPre = pickUp.precondition()->as(); - REQUIRE(pickUpPre.arguments().size() == 3u); - const auto &pickUpPre0 = pickUpPre.arguments()[0]->as(); - CHECK(pickUpPre0.name() == "clear"); - REQUIRE(pickUpPre0.arguments().size() == 1u); - const auto &pickUpPre00 = pickUpPre0.arguments()[0]->as(); - CHECK(pickUpPre00.name() == "x"); - CHECK(pickUpPre00.type() == &block); - CHECK(&pickUpPre00 == pickUp.parameters()[0].get()); - const auto &pickUpPre2 = pickUpPre.arguments()[2]->as(); - CHECK(pickUpPre2.name() == "handempty"); - CHECK(pickUpPre2.arguments().empty()); - - const auto &pickUpEff = pickUp.effect()->as(); - REQUIRE(pickUpEff.arguments().size() == 4u); - const auto &pickUpEff0 = pickUpEff.arguments()[0]->as(); - const auto &pickUpEff00 = pickUpEff0.argument()->as(); - CHECK(pickUpEff00.name() == "ontable"); - REQUIRE(pickUpEff00.arguments().size() == 1u); - const auto &pickUpEff000 = pickUpEff00.arguments()[0]->as(); - CHECK(pickUpEff000.name() == "x"); - CHECK(pickUpEff000.type() == &block); -} -*/