📝 clean up

This commit is contained in:
Niels Lohmann
2024-12-22 14:20:10 +01:00
parent e9876d9e46
commit b167096e82
3 changed files with 8 additions and 5 deletions

View File

@@ -1000,8 +1000,11 @@ TEST_CASE("regression tests 2")
{
nlohmann::json node;
node["test"] = "test\334\005";
const auto test_dump = node.dump(-1, ' ', false, nlohmann::json::error_handler_t::keep);
CHECK(test_dump == "{\"test\":\"test\334\005\"}");
auto x = node.dump(-1, ' ', false, nlohmann::json::error_handler_t::ignore);
CHECK(node.dump(-1, ' ', false, nlohmann::json::error_handler_t::ignore) == "{\"test\":\"test\\u0005\"}");
CHECK(node.dump(-1, ' ', false, nlohmann::json::error_handler_t::keep) == "{\"test\":\"test\334\005\"}");
CHECK(node.dump(-1, ' ', true, nlohmann::json::error_handler_t::keep) == "{\"test\":\"test\334\005\"}");
}
}