Add size_t MapVector::erase(KeyT) similar to the one in std::map.
[oota-llvm.git] / unittests / ADT / MapVectorTest.cpp
index 92f0dc41910b2ff8c6924c3fb7f03f68d20bc12e..0580580977e6ae95d0abebd18eaba689e04fb08c 100644 (file)
@@ -67,6 +67,11 @@ TEST(MapVectorTest, erase) {
   ASSERT_EQ(MV.find(1), MV.end());
   ASSERT_EQ(MV[3], 4);
   ASSERT_EQ(MV[5], 6);
+
+  MV.erase(3);
+  ASSERT_EQ(MV.size(), 1u);
+  ASSERT_EQ(MV.find(3), MV.end());
+  ASSERT_EQ(MV[5], 6);
 }
 
 TEST(MapVectorTest, remove_if) {