Escaping predicates containing hyphens for ASP output.
This commit is contained in:
16
tests/TestUtils.cpp
Normal file
16
tests/TestUtils.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <plasp/utils/Parsing.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TEST(UtilsTests, EscapeASP)
|
||||
{
|
||||
const std::string predicate = "action(stack_on(block-1, block-2))";
|
||||
|
||||
const auto escaped = plasp::utils::escapeASP(predicate);
|
||||
const auto unescaped = plasp::utils::unescapeASP(escaped);
|
||||
|
||||
ASSERT_EQ(escaped.find("-"), std::string::npos);
|
||||
ASSERT_EQ(predicate, unescaped);
|
||||
}
|
Reference in New Issue
Block a user