-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[gardening] Migrate from unwrapped() to XCTUnwrap() #2462
[gardening] Migrate from unwrapped() to XCTUnwrap() #2462
Conversation
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.
We're using .unwrapped()
in a non-test sense in GenerateTestFixtures. You'll either have to scrap this or shim it there.
GenerateTestFixtures has its own implementation and I haven't touch it with this commit (ref: the file as it is with this commit https://github.com/apple/swift-corelibs-foundation/blob/d3df79dc5f2624be38dd7086a2291a51452111a9/Tools/GenerateTestFixtures/GenerateTestFixtures/Utilities.swift) |
All right. I understand what you mean. It can be modified. I think it flew under my radar because CMake doesn't seem to build that target. |
7017fc9
to
4a70b78
Compare
@swift-ci please test Linux Platform |
It is intentional that CMake doesn't build that target; that target is meant to be built on macOS with the shipping version of Xcode, for now. |
More to the point, right now we're building that target for Mojave (to generate the macOS-10.14 test fixtures in TestFoundation/Fixtures). |
I hadn't thought this through — of course we can build GTF with XCTUnwrap, since you're providing one. Whoops. |
@swift-ci please test and merge |
1 similar comment
@swift-ci please test and merge |
I'll need to catch up with new tests. |
Instead of using an extension on Optional only available in Foundation, we should start using the recently introduced XCTUnwrap available in XCTest to perform the same job. The XCTest API would probably be more known in other code bases, so people will be more willing to use it and learn it. The commit removes all the usages of unwrapped and replaces them with XCTUnwrap. Additionally it marks unwrapped() as deprecated, so people receive a clear message about the disappearance with a helpful hint of what to use instead.
4a70b78
to
9b83d91
Compare
Removed the @swift-ci please test |
@swift-ci please test |
@swift-ci please test Linux platform |
Instead of using an extension on Optional only available in Foundation,
we should start using the recently introduced XCTUnwrap available in
XCTest to perform the same job. The XCTest API would probably be more
known in other code bases, so people will be more willing to use it and
learn it.
The commit removes all the usages of unwrapped and replaces them with
XCTUnwrap. Additionally it marks unwrapped() as deprecated, so people
receive a clear message about the disappearance with a helpful hint of
what to use instead.