test(core): add unit tests for merge trait#1738
Merged
notmandatory merged 1 commit intobitcoindevkit:masterfrom Feb 4, 2025
Merged
test(core): add unit tests for merge trait#1738notmandatory merged 1 commit intobitcoindevkit:masterfrom
merge trait#1738notmandatory merged 1 commit intobitcoindevkit:masterfrom
Conversation
LagginTimes
reviewed
Nov 24, 2024
Contributor
There was a problem hiding this comment.
Would it be valuable to include tests for conflict scenarios as well? For example:
let mut map1: BTreeMap<i32, &str> = BTreeMap::new();
map1.insert(1, "a");
let mut map2: BTreeMap<i32, &str> = BTreeMap::new();
map2.insert(1, "b");
map1.merge(map2);
assert_eq!(map1.len(), 1);
assert_eq!(map1.get(&1), Some(&"b"));
Contributor
Author
|
I've added refactored empty check assertions and merge conflict tests. Squashed. |
evanlinjin
approved these changes
Nov 26, 2024
Contributor
|
ACK 665273d |
evanlinjin
requested changes
Nov 30, 2024
Member
evanlinjin
left a comment
There was a problem hiding this comment.
Great test additions. Here are some suggestions to make the tests more complete/easier to read.
Contributor
Author
|
Indeed, that's more readable. Updated. |
evanlinjin
previously requested changes
Dec 3, 2024
Member
evanlinjin
left a comment
There was a problem hiding this comment.
Thanks for pushing forward on this. Let me know if you have any questions.
Contributor
Author
|
Fixed and Rebased |
ValuedMammal
approved these changes
Jan 17, 2025
Member
|
Please rebase to pick up CI changes from #1803. |
…ncluding conflict scenarios and checking for empty structures
a53f07b to
fcc0a34
Compare
Member
|
I did the rebase. :-) |
39 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This update adds unit tests for the
Mergetrait implementations onBTreeMap,BTreeSet,Vec, and tuples. It also includes tests for theis_emptyandtakemethods to ensure their correct functionality.Notes to the Reviewers
BTreeSet's existingtakemethod.Changelog Notice
is_empty,take) on various collection types.Checklists
All Submissions:
cargo fmtandcargo clippybefore committing.