This repository has been archived on 2023-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
plasp/tests/TestUtils.cpp

18 lines
535 B
C++

#include <gtest/gtest.h>
#include <plasp/utils/Parsing.h>
////////////////////////////////////////////////////////////////////////////////////////////////////
TEST(UtilsTests, EscapeASP)
{
const std::string predicate = "action(stack_on(block-1, block-2, value@3, value@4))";
const auto escaped = plasp::utils::escapeASP(predicate);
const auto unescaped = plasp::utils::unescapeASP(escaped);
ASSERT_EQ(escaped.find("-"), std::string::npos);
ASSERT_EQ(escaped.find("@"), std::string::npos);
ASSERT_EQ(predicate, unescaped);
}