#include #include #include #include #include "quote.hpp" #include "unquote.hpp" int main() try { using namespace boost::algorithm; std::string a("simple test"); std::string b(quote(a)); BOOST_ASSERT("\"simple test\"" == b); b = unquote(b); BOOST_ASSERT(a == b); b = quote(a, ' ', '%'); BOOST_ASSERT(" simple% test " == b); b = unquote(b, ' ', '%'); BOOST_ASSERT(a == b); a = "simple\\ test"; b = quote(a, '%'); BOOST_ASSERT("%simple\\\\ test%" == b); b = unquote(b, '%'); BOOST_ASSERT(a == b); } catch (std::logic_error const & e) { std::cout << "Caught exception: " << e.what() << std::endl; }