-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Adding tests for replaceSubrange overloads for range types #2774
Conversation
@swift-ci Please test |
@@ -44,6 +51,78 @@ internal enum RangeSelection { | |||
return start..<end | |||
} | |||
} | |||
|
|||
internal func countableRange<C : Collection>(in c: C) -> CountableRange<C.Index> { | |||
switch self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return CountableRange(range(in: c))
?
We already generate |
var c = makeWrappedCollection(test.collection) | ||
let rangeToReplace = test.rangeSelection.closedRange(in: c) | ||
let newElements = | ||
MinimalCollection(elements: test.newElements.map(wrapValue)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be using makeWrappedCollection
.
Thank you for the feedback! I will have an updated PR for you tonight. All tests were passing for me before I pushed, so I will investigate to see why. |
5d9d06a
to
32bbcaa
Compare
@gribozavr I've rewritten the tests and everything passes now. I'll do |
Thanks Austin! I didn't look closely at the patch, but let's trigger the CI: @swift-ci Please test |
If there are no problems, you can push it whenever CI passes. The tests passed locally on my box. |
I don't think the test failures are related to this commit. On OS X, this test (which involves a file that seems to have been touched by a recent commit) fails:
On Linux, the error looks like this:
|
d674eac
to
4a94899
Compare
Just wanted to check in on this PR @gribozavr. If you're busy I can start working on the String tests concurrently. |
@austinzheng Sorry for the silence! I will try to get a review soon. Please start as many concurrent PRs as you are comfortable with. |
4a94899
to
dafa317
Compare
I have a branch with similar tests to these, but for I'll make a PR after this one is merged, because that branch depends on changes in this one. I'll also get started on the |
@@ -12,14 +12,14 @@ | |||
|
|||
import StdlibUnittest | |||
|
|||
internal enum RangeSelection { | |||
public enum RangeSelection { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to end up using this enum from at least two more test files. Would it be a good idea to move it into a new 'Utilities' style file?
dafa317
to
cde9b37
Compare
No objections, but I'd prefer to call it |
a8fbf7f
to
85e0695
Compare
85e0695
to
7966bd8
Compare
I moved the |
@swift-ci Please test |
@austinzheng PR looks good to me. Is it ready to be merged? Please modify the description if so ;-) Thanks. |
@moiseev Done, thanks so much! It is indeed ready to be merged. |
[pull] swiftwasm from main
Tests for
RangeReplaceableCollection
's newreplaceSubrange()
overloads, for use with the new ranges.EDIT: Tests all run and pass successfully, this PR can be merged at any time.
@gribozavr
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
Lint Testing
Note: Only members of the Apple organization can trigger swift-ci.