Skip to content

[stdlib] Make test for Sequence.map actually test a sequence #17481

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

Merged
merged 1 commit into from
Jun 26, 2018

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jun 25, 2018

AnySequence just forwards the call to map to its underlying storage which currently is an Array (and thus a collection).
Using MinimalSequence guarantees that we are actually calling a Sequence.map.

@ahoppen ahoppen requested a review from airspeedswift June 25, 2018 21:15
@ahoppen
Copy link
Member Author

ahoppen commented Jun 25, 2018

@swift-ci Please smoke test

@airspeedswift
Copy link
Member

stride might, at some point, become a collection. There are dedicated types in the std lib test suite for when you explicitly want to test a particular protocol – have a look for uses of MinimalSequence.

AnySequence just forwards the call to map to its underlying storage
which used to be an Array (and thus a collection).
@ahoppen
Copy link
Member Author

ahoppen commented Jun 25, 2018

Updated to use MinimalSequence.

@swift-ci Please smoke test

Copy link
Member

@airspeedswift airspeedswift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ahoppen ahoppen merged commit 545302e into swiftlang:master Jun 26, 2018
@rudkx
Copy link
Contributor

rudkx commented Jun 26, 2018

@ahoppen StdlibCollectionUnittest is only built for validation tests, so this will fail for anyone who runs the plain test suite locally.

@ahoppen ahoppen deleted the sequence-test branch August 22, 2018 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants