2016-10-08 16:03:14 +02:00
|
|
|
#include <catch.hpp>
|
2016-06-14 01:31:22 +02:00
|
|
|
|
|
|
|
#include <boost/iostreams/stream.hpp>
|
|
|
|
#include <boost/iostreams/device/null.hpp>
|
|
|
|
|
|
|
|
#include <plasp/pddl/Description.h>
|
|
|
|
#include <plasp/pddl/TranslatorASP.h>
|
|
|
|
|
|
|
|
using namespace plasp::pddl;
|
|
|
|
|
|
|
|
boost::iostreams::stream<boost::iostreams::null_sink> nullStream((boost::iostreams::null_sink()));
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-10-08 16:03:14 +02:00
|
|
|
TEST_CASE("[PDDL translation] Former issues are fixed", "[PDDL translation]")
|
2016-06-14 01:31:22 +02:00
|
|
|
{
|
2016-11-29 06:03:05 +01:00
|
|
|
plasp::output::Logger logger;
|
2017-05-12 14:17:57 +02:00
|
|
|
Context context(Tokenizer(), logger);
|
2016-11-29 06:03:05 +01:00
|
|
|
|
|
|
|
SECTION("translating domains without typing information works")
|
2016-08-16 18:58:30 +02:00
|
|
|
{
|
2016-11-29 06:03:05 +01:00
|
|
|
auto description = Description::fromFile("data/issues/issue-4.pddl", context);
|
2016-08-16 18:58:30 +02:00
|
|
|
const auto translator = TranslatorASP(description, description.context().logger.outputStream());
|
2016-11-29 06:03:05 +01:00
|
|
|
CHECK_NOTHROW(translator.translate());
|
2016-08-16 18:58:30 +02:00
|
|
|
}
|
|
|
|
|
2016-11-29 06:03:05 +01:00
|
|
|
SECTION("translating the simple blocks world domain works")
|
2016-08-16 18:58:30 +02:00
|
|
|
{
|
2016-11-29 06:03:05 +01:00
|
|
|
auto description = Description::fromFile("data/issues/issue-5.pddl", context);
|
2016-08-16 18:58:30 +02:00
|
|
|
const auto translator = TranslatorASP(description, description.context().logger.outputStream());
|
2016-11-29 06:03:05 +01:00
|
|
|
CHECK_NOTHROW(translator.translate());
|
2016-08-16 18:58:30 +02:00
|
|
|
}
|
2016-06-14 01:31:22 +02:00
|
|
|
}
|