mirror of
https://github.com/nlohmann/json.git
synced 2026-03-22 17:02:45 +00:00
Fixed dumping of strings
This commit is contained in:
@@ -819,6 +819,17 @@ TEST_CASE("string")
|
||||
j1.clear();
|
||||
CHECK(j1.get<std::string>() == "");
|
||||
}
|
||||
|
||||
SECTION("Dumping")
|
||||
{
|
||||
CHECK(json("\"").dump(0) == "\"\\\"\"");
|
||||
CHECK(json("\\").dump(0) == "\"\\\\\"");
|
||||
CHECK(json("\n").dump(0) == "\"\\n\"");
|
||||
CHECK(json("\t").dump(0) == "\"\\t\"");
|
||||
CHECK(json("\b").dump(0) == "\"\\b\"");
|
||||
CHECK(json("\f").dump(0) == "\"\\f\"");
|
||||
CHECK(json("\r").dump(0) == "\"\\r\"");
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("boolean")
|
||||
|
||||
Reference in New Issue
Block a user