Merged
Conversation
dylandreimerink
approved these changes
Sep 9, 2024
Member
dylandreimerink
left a comment
There was a problem hiding this comment.
Changes all look good to me
florianl
approved these changes
Sep 9, 2024
ti-mo
requested changes
Sep 11, 2024
Contributor
ti-mo
left a comment
There was a problem hiding this comment.
Thanks for splitting this up into smaller bits. Please try not to move stuff (like the variable declarations) around without a clear benefit. It causes churn and makes things more time-consuming to review.
This commit introduces in the test sections for the maps the peek operation performed on a queue. It verifies that the 1st value is correctly returned and not removed from the data structure (lookup operation), and also that it returns the error `ErrKeyNotExist` on an empty queue. Signed-off-by: Simone Magnani <[email protected]>
This commit performs a small refactoring to some of the map tests, trying to shorten a bit, while also cleaning unnecessary code. Signed-off-by: Simone Magnani <[email protected]>
This commit introduces the `TestIterateWrongMap` test, which should assert that the `MapIterator` fails while called on keyless maps such as queues. We do not expect different behaviours, as the `MapIterator.Next` relies on the presence of a key for which it lookups the value. A different method can be later introduces to also traverse a queue, but in that case we'd need to additionally remove the value. Signed-off-by: Simone Magnani <[email protected]>
2613a2c to
fbc3585
Compare
ti-mo
approved these changes
Sep 12, 2024
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.
This PR introduces a new test for
MapIteratoras well as small refactoring to some other tests.With this, the aim is primarily to ensure that
MapIteratorfails when called on keyless maps such as queues/stacks: this is because the current implementation relies on a key (nextKey) lookup from the map, which is then used to retrieve its respective value.Commit messages should contain each the explanation, feel free to reach me for further q&a 😃