SI-8815 mutable.LongMap makes different choices for splitAt vs etc.#3941
Merged
lrytz merged 1 commit intoscala:2.11.xfrom Sep 16, 2014
Merged
SI-8815 mutable.LongMap makes different choices for splitAt vs etc.#3941lrytz merged 1 commit intoscala:2.11.xfrom
lrytz merged 1 commit intoscala:2.11.xfrom
Conversation
Member
|
I think we should add some unit tests for these fixes. Or do we rely on the upcoming test generator? |
Contributor
|
ping @Ichoran |
Contributor
Author
|
@lrytz @gkossakowski - I was not going to bother with extra unit tests because the collections test generator catches these (that's how I found them in the first place). In fact, once the test generator is in place I'd like to rip out a bunch of unit tests that are no longer necessary to speed up the tests. Maybe I should add a test for Long.MinValue, though--that isn't part of the testing. |
It turns out that take/drop/splitAt/takeWhile/dropWhile inherit a smattering of foreach vs. iterator-based implementations. These aren't consistent unless they iterate in the same order. This probably reflects an undesirable underlying weakness, but in this particular case it was easy to make LongMap's foreach order agree with iterator. Made traversal order of other foreach-like methods match also. Also fixed a bug where Long.MinValue wasn't iterated. Added unit test for iteration coverage of extreme values.
Contributor
Author
|
@lrytz @gkossakowski - I added a unit test to test potentially special values. |
Member
|
LGTM |
lrytz
added a commit
that referenced
this pull request
Sep 16, 2014
SI-8815 mutable.LongMap makes different choices for splitAt vs etc.
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.
It turns out that take/drop/splitAt/takeWhile/dropWhile inherit a smattering of foreach vs. iterator-based implementations. These aren't consistent unless they iterate in the same order. This probably reflects an undesirable underlying weakness, but in this particular case it was easy to make LongMap's foreach order agree with iterator.
Made traversal order of other foreach-like methods match also.
Also fixed a bug where Long.MinValue wasn't iterated.