From b5211b9b213273c642a790ae3c3f3bbe1a4cf51e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 21 Apr 2021 12:21:41 +0200 Subject: json: Encode NULL strings as null This is the only nullable thing we have here. --- test/libapt/json_test.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/libapt/json_test.cc b/test/libapt/json_test.cc index 9c29936f6..ee8f3cebe 100644 --- a/test/libapt/json_test.cc +++ b/test/libapt/json_test.cc @@ -59,3 +59,11 @@ TEST(JsonTest, JsonStackRegression) EXPECT_EQ("{\"a\":[{}],\"b\":[{}]}", os.str()); } +TEST(JsonTest, JsonNull) +{ + std::ostringstream os; + + JsonWriter(os).value(nullptr); + + EXPECT_EQ("null", os.str()); +} -- cgit v1.2.3-70-g09d2