mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[blotmapvector] Add support for try_emplace.
I am going to use this in a forthcoming commit.
This commit is contained in:
@@ -464,6 +464,19 @@ TYPED_TEST(BlotMapVectorTest, InsertTest) {
|
||||
this->NumExpectedLiveTesters = 1;
|
||||
}
|
||||
|
||||
// Test try_emplace() method
|
||||
TYPED_TEST(BlotMapVectorTest, TryEmplaceTest) {
|
||||
this->Map.try_emplace(this->getKey(), this->getValue());
|
||||
EXPECT_EQ(1u, this->Map.size());
|
||||
EXPECT_EQ(this->getValue(), this->Map[this->getKey()]);
|
||||
EXPECT_EQ(1u, this->Map.size());
|
||||
this->Map.try_emplace(this->getKey(), this->getValue());
|
||||
EXPECT_EQ(1u, this->Map.size());
|
||||
EXPECT_EQ(this->getValue(), this->Map[this->getKey()]);
|
||||
EXPECT_EQ(1u, this->Map.size());
|
||||
this->NumExpectedLiveTesters = 1;
|
||||
}
|
||||
|
||||
// Test copy constructor method
|
||||
TYPED_TEST(BlotMapVectorTest, CopyConstructorTest) {
|
||||
this->Map[this->getKey()] = this->getValue();
|
||||
|
||||
Reference in New Issue
Block a user