| 10 | using namespace osrm::util; |
| 11 | |
| 12 | BOOST_AUTO_TEST_CASE(json_escaping) |
| 13 | { |
| 14 | std::string input{"\b\\"}; |
| 15 | std::string output; |
| 16 | EscapeJSONString(input, output); |
| 17 | |
| 18 | BOOST_CHECK(RequiresJSONStringEscaping(input)); |
| 19 | BOOST_CHECK_EQUAL(output, "\\b\\\\"); |
| 20 | |
| 21 | input = "Aleja \"Solidarnosci\""; |
| 22 | output.clear(); |
| 23 | EscapeJSONString(input, output); |
| 24 | BOOST_CHECK(RequiresJSONStringEscaping(input)); |
| 25 | BOOST_CHECK_EQUAL(output, "Aleja \\\"Solidarnosci\\\""); |
| 26 | |
| 27 | BOOST_CHECK(!RequiresJSONStringEscaping("Aleja Solidarnosci")); |
| 28 | } |
| 29 | |
| 30 | BOOST_AUTO_TEST_SUITE_END() |
nothing calls this directly
no test coverage detected