Skip to content

Define XCTestCaseClosure typealias #204

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
Oct 19, 2017
Merged

Conversation

tiagomartinho
Copy link
Contributor

I believe the following type alias can improve the readability of the code, what do you think?

@modocache
Copy link
Contributor

I like it! Could we brainstorm some additional names, tough? In the context of the XCTest framework, XCTestClosure could refer to any closure, so I feel it's ambiguous. Maybe XCTTestMethodClosure? Or something else?

@tiagomartinho
Copy link
Contributor Author

Of course!

I choose XCTestClosure because I tend to favor shorter names. Initially I was thinking in XCTestCaseClosure, but I also like XCTestMethodClosure.

Let me know which one you prefer and I will make the change.

@modocache
Copy link
Contributor

Personally I like XCTestCaseClosure -- in theory these don't have to be methods, after all.

@tiagomartinho tiagomartinho force-pushed the master branch 2 times, most recently from ccfc1de to 2b84b35 Compare October 11, 2017 07:33
@tiagomartinho
Copy link
Contributor Author

@modocache I changed it to XCTestCaseClosure

@tiagomartinho tiagomartinho changed the title Define XCTestClosure typealias Define XCTestCaseClosure typealias Oct 11, 2017
public typealias XCTestCaseEntry = (testCaseClass: XCTestCase.Type, allTests: [(String, (XCTestCase) throws -> Void)])
public typealias XCTestCaseEntry = (testCaseClass: XCTestCase.Type, allTests: [(String, XCTestCaseClosure)])

public typealias XCTestCaseClosure = (XCTestCase) throws -> Void
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, a bit of a nit-pick: how about moving this typealias above the first, so that readers don't encounter XCTestCaseClosure before it's defined?

Also, this typealias could use some documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I totally agree!

Let me know if the documentation is helpful or it needs improvements.

@modocache
Copy link
Contributor

modocache commented Oct 11, 2017

Great, looks good to me! Thanks.

@swift-ci please test

@tiagomartinho
Copy link
Contributor Author

There was some problem with the merge?

@modocache
Copy link
Contributor

@swift-ci Please test

@briancroom
Copy link
Contributor

Thanks guys, this does look good!

@modocache modocache merged commit 2674f2f into swiftlang:master Oct 19, 2017
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