-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[ADT] Add DenseMap::insert_range
#133600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADT] Add DenseMap::insert_range
#133600
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -379,6 +379,28 @@ TEST(DenseMapCustomTest, EqualityComparison) { | |
| EXPECT_NE(M1, M3); | ||
| } | ||
|
|
||
| TEST(DenseMapCustomTest, InsertRange) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we also have a test for SmallDenseSet?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added in
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I meant SmallDenseMap
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. I think it's fine either way. |
||
| DenseMap<int, int> M; | ||
|
|
||
| std::pair<int, int> InputVals[3] = {{0, 0}, {0, 1}, {1, 2}}; | ||
| M.insert_range(InputVals); | ||
|
|
||
| EXPECT_EQ(M.size(), 2u); | ||
| EXPECT_THAT(M, testing::UnorderedElementsAre(testing::Pair(0, 0), | ||
| testing::Pair(1, 2))); | ||
| } | ||
|
|
||
| TEST(SmallDenseMapCustomTest, InsertRange) { | ||
| SmallDenseMap<int, int> M; | ||
|
|
||
| std::pair<int, int> InputVals[3] = {{0, 0}, {0, 1}, {1, 2}}; | ||
| M.insert_range(InputVals); | ||
|
|
||
| EXPECT_EQ(M.size(), 2u); | ||
| EXPECT_THAT(M, testing::UnorderedElementsAre(testing::Pair(0, 0), | ||
| testing::Pair(1, 2))); | ||
| } | ||
|
|
||
| // Test for the default minimum size of a DenseMap | ||
| TEST(DenseMapCustomTest, DefaultMinReservedSizeTest) { | ||
| // IF THIS VALUE CHANGE, please update InitialSizeTest, InitFromIterator, and | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.