Index: test/compiled/StringMap.cpp |
=================================================================== |
--- a/test/compiled/StringMap.cpp |
+++ b/test/compiled/StringMap.cpp |
@@ -40,46 +40,50 @@ |
EXPECT_EQ(map.size(), 2); |
auto entry = map.find(u"Foobar"_str); |
EXPECT_TRUE(entry); |
entry = map.find(u"Foobar2"_str); |
EXPECT_FALSE(entry); |
- map[u"Foobar2"_str] = "two"; |
+rr map[u"Foobar2"_str] = "two"; |
sergei
2018/02/13 15:01:39
could you please also remove it? :)
hub
2018/02/13 15:08:44
*sigh*. how did that slide in.
Done
|
entry = map.find(u"Foobar2"_str); |
EXPECT_TRUE(entry); |
map[u"Foobar3"_str] = "three"; |
entry = map.find(u"Foobar3"_str); |
EXPECT_TRUE(entry); |
EXPECT_EQ(map.size(), 4); |
- map.erase(u"Foobar2"_str); |
+ EXPECT_TRUE(map.erase(u"Foobar2"_str)); |
+ // already deleted. Returns false. |
+ EXPECT_FALSE(map.erase(u"Foobar2"_str)); |
+ // invalid. Returns false. |
+ EXPECT_FALSE(map.erase(u"Foobar42"_str)); |
- // DISABLED. This should be true, but it isn't |
- //EXPECT_EQ(map.size(), 3); |
+ EXPECT_EQ(map.size(), 4); |
entry = map.find(u"Foobar2"_str); |
EXPECT_FALSE(entry); |
int i = 0; |
for (const auto& e : map) |
{ |
EXPECT_FALSE(e.is_invalid()); |
- // DISABLED entries that are deleted shouldn't be returned. |
- // See issue #6281 |
- //EXPECT_FALSE(e.is_deleted()); |
+ // entries that are deleted shouldn't be returned. |
+ EXPECT_FALSE(e.is_deleted()); |
i++; |
} |
- EXPECT_EQ(i, 4); // SHOULD be 3. See issue #6281 |
- EXPECT_EQ(i, map.size()); |
+ EXPECT_EQ(i, 3); |
+ // We did not return deleted entries (there is one). |
+ // So size is different than actual count. |
+ EXPECT_NE(i, map.size()); |
} |
TEST(TestStringMap, stringMap) |
{ |
testStringMap<StringMap>(); |
} |
TEST(TestStringMap, ownedStringMap) |