From 5ee0188f2b87c7600ab2fef8f630efb75aeb57d5 Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Thu, 18 Oct 2018 08:47:24 +0000 Subject: [Support] json::Value construction from std::vector and std::map. Summary: Previously this required a conversion to json::Array/json::Object first. Reviewers: ioeric Subscribers: kristina, llvm-commits Differential Revision: https://reviews.llvm.org/D53385 llvm-svn: 344732 --- llvm/unittests/Support/JSONTest.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/unittests/Support/JSONTest.cpp') diff --git a/llvm/unittests/Support/JSONTest.cpp b/llvm/unittests/Support/JSONTest.cpp index 64a2bb97bd8..9f2d47b9aa9 100644 --- a/llvm/unittests/Support/JSONTest.cpp +++ b/llvm/unittests/Support/JSONTest.cpp @@ -47,6 +47,8 @@ TEST(JSONTest, Constructors) { s(Object{{"A", Object{{"B", Object{{"X", "Y"}}}}}})); EXPECT_EQ("null", s(llvm::Optional())); EXPECT_EQ("2.5", s(llvm::Optional(2.5))); + EXPECT_EQ("[[2.5,null]]", s(std::vector>>{ + {2.5, llvm::None}})); } TEST(JSONTest, StringOwnership) { -- cgit v1.2.3