Added test for removal of trailing parantheses with 0-ary predicates.

This commit is contained in:
2016-05-23 00:47:30 +02:00
parent ea1dcef788
commit 081b604c40
2 changed files with 506 additions and 1 deletions

View File

@@ -13,7 +13,8 @@ class SASParserTests : public ::testing::Test
{
protected:
SASParserTests()
: m_philosophersTestFile(readFile("data/philosophers.sas"))
: m_blocksworldTestFile(readFile("data/blocksworld.sas")),
m_philosophersTestFile(readFile("data/philosophers.sas"))
{
}
@@ -31,6 +32,7 @@ class SASParserTests : public ::testing::Test
return outputStream;
}
std::stringstream m_blocksworldTestFile;
std::stringstream m_philosophersTestFile;
};
@@ -109,6 +111,23 @@ TEST_F(SASParserTests, ParseValidSASFile)
////////////////////////////////////////////////////////////////////////////////////////////////////
TEST_F(SASParserTests, RemoveTrailingParentheses)
{
try
{
const auto description = plasp::sas::Description::fromStream(m_blocksworldTestFile);
ASSERT_EQ(description.variables()[4].values()[0].name(), "handempty");
ASSERT_EQ(description.variables()[5].values()[0].name(), "holding(a)");
}
catch (const std::exception &e)
{
FAIL () << e.what();
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);