[stdlib] New indexing model: Fix LazyFilterCollection index moving#2070
Merged
moiseev merged 2 commits intoswiftlang:swift-3-indexing-modelfrom Apr 7, 2016
Merged
Conversation
The index moving methods weren't functioning correctly. They didn't trap on advancing past endIndex and in some cases did not terminate at all.
Contributor
|
Here is the test that starts to fail after your change. Don't get me wrong, it's an improvement, as it used to not terminate at all ;-) tests.test("LazyFilterCollection") {
let xs = (0..<3).lazy.filter { $0 % 2 == 0 }
expectEqual(0, xs[xs.startIndex])
}The problem, I believe, is that The following test might help to find more problems like this: tests.test("LazyFilterCollection") {
let xs = (0..<3).lazy.filter { $0 % 2 == 0 }
checkForwardCollection([0, 2], xs) {
$0 == $1
}
} |
Member
Author
|
Sorry about that! Fixed now and tested on better inputs. |
Contributor
|
I ran the tests locally. |
MaxDesiatov
added a commit
that referenced
this pull request
Apr 19, 2021
Use macOS 10.15 on GitHub Actions
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.
What's in this pull request?
The index moving methods weren't functioning correctly. They didn't trap on advancing past
endIndexand in some cases did not terminate at all.Resolved bug number: n/a
Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
Validation Testing
Note: Only members of the Apple organization can trigger swift-ci.