diff options
author | Qingyang Chen <qingyang.chen@10gen.com> | 2015-07-16 14:38:03 -0400 |
---|---|---|
committer | Qingyang Chen <qingyang.chen@10gen.com> | 2015-07-23 10:43:46 -0400 |
commit | 84921ca797830b4adaedae01a4357d2bfccfb0a6 (patch) | |
tree | 483c3a19bbf9d0cceda078c418048278cbdeaf93 /src/mongo/util/string_map_test.cpp | |
parent | 162fb82bed75ede539bbb960f44d232f8b8e5848 (diff) | |
download | mongo-84921ca797830b4adaedae01a4357d2bfccfb0a6.tar.gz |
SERVER-19450 UnorderedFastKeyTable/StringMap construct with std::initializer_list
Diffstat (limited to 'src/mongo/util/string_map_test.cpp')
-rw-r--r-- | src/mongo/util/string_map_test.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/util/string_map_test.cpp b/src/mongo/util/string_map_test.cpp index 6e49d34bdc5..0fbcfe2d28f 100644 --- a/src/mongo/util/string_map_test.cpp +++ b/src/mongo/util/string_map_test.cpp @@ -205,4 +205,14 @@ TEST(StringMapTest, Assign) { y = m; ASSERT_EQUALS(5, y["eliot"]); } + +TEST(StringMapTest, InitWithInitializerList) { + StringMap<int> smap{ + {"q", 1}, {"coollog", 2}, {"mango", 3}, {"mango", 4}, + }; + + ASSERT_EQ(1, smap["q"]); + ASSERT_EQ(2, smap["coollog"]); + ASSERT_EQ(3, smap["mango"]); +} } |