aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2018-10-18 08:47:24 +0000
committerSam McCall <sam.mccall@gmail.com>2018-10-18 08:47:24 +0000
commit6071e3bbc0027598049dbd9b6379d88491ca597d (patch)
treeffcd8550a7f3e26e5298899527445497ae45ca12 /unittests
parentacedb9c3916e017a4595f2c57f781bb0cfb84d61 (diff)
[Support] json::Value construction from std::vector<T> and std::map<string,T>.
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344732 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Support/JSONTest.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/unittests/Support/JSONTest.cpp b/unittests/Support/JSONTest.cpp
index 64a2bb97bd8..9f2d47b9aa9 100644
--- a/unittests/Support/JSONTest.cpp
+++ b/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<double>()));
EXPECT_EQ("2.5", s(llvm::Optional<double>(2.5)));
+ EXPECT_EQ("[[2.5,null]]", s(std::vector<std::vector<llvm::Optional<double>>>{
+ {2.5, llvm::None}}));
}
TEST(JSONTest, StringOwnership) {