mirror of
https://github.com/nlohmann/json.git
synced 2026-02-24 20:36:27 +00:00
Serialize empty tuple into '[]' instead of null (#4594)
Signed-off-by: Michael Valladolid <mikevalladolid@gmail.com>
This commit is contained in:
committed by
GitHub
parent
e72046ef9f
commit
bdb8d2b7b3
@@ -814,6 +814,15 @@ TEST_CASE("regression tests 2")
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("issue #4530 - Serialization of empty tuple")
|
||||
{
|
||||
const auto source_tuple = std::tuple<>();
|
||||
const nlohmann::json j = source_tuple;
|
||||
|
||||
CHECK(j.get<decltype(source_tuple)>() == source_tuple);
|
||||
CHECK("[]" == j.dump());
|
||||
}
|
||||
|
||||
SECTION("issue #2865 - ASAN detects memory leaks")
|
||||
{
|
||||
// the code below is expected to not leak memory
|
||||
|
||||
Reference in New Issue
Block a user