Skip to content
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

[SR-1063] Have XCTestObservationCenter conform to new Swift 3 naming rules #397

Closed
modocache mannequin opened this issue Mar 25, 2016 · 8 comments
Closed

[SR-1063] Have XCTestObservationCenter conform to new Swift 3 naming rules #397

modocache mannequin opened this issue Mar 25, 2016 · 8 comments

Comments

@modocache
Copy link
Mannequin

modocache mannequin commented Mar 25, 2016

Previous ID SR-1063
Radar None
Original Reporter @modocache
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s XCTest
Labels Bug, StarterBug
Assignee shingt (JIRA)
Priority Medium

md5: da16a265f7fa73b0cb4ebaf710ed7ada

Issue Description:

swift-corelibs-xctest's XCTestObservationCenter defines a method sharedTestObservationCenter. However, that method in Apple XCTest is now named simply shared.

swift-corelibs-xctest's XCTestObservationCenter should define shared as well, since our goal is to have an identical API. Change the method name and update the tests.

(I wonder if there are other discrepancies brought about by the Swift 3 naming rules? We should investigate.)

@swift-ci
Copy link

Comment by Shinichi Goto (JIRA)

> However, that method in Apple XCTest is now named simply shared.

Where can I find this?

@modocache
Copy link
Mannequin Author

modocache mannequin commented Mar 26, 2016

  1. Download a Swift 3 snapshot from https://swift.org, such as the 3-24 snapshot.

  2. Open Xcode. In the preferences pane, select the Swift 3 toolchain as the active toolchain.

  3. Create a new iOS app project named "Foo" in Xcode, choosing "Swift" as your language, and checking the box marked "Include unit tests".

  4. Your project should include a "FooTests.swift" file. Within that file, type XCTestObservationCenter.sha. Autocompletion should suggest XCTestObservation.shared().

  5. Finish typing XCTestObservation.shared(), then navigate to the symbol definition in Xcode by holding down the command key and clicking on shared(). The Swift header generated by the Swift ClangImporter should show func shared() as being defined.

@swift-ci
Copy link

Comment by Shinichi Goto (JIRA)

Thanks and sorry for my stupid question. I was looking for only in swift repo and so I couldn't find it.
I made a PR, and will investigate if other differences from Swift 3 rules exist as well.

@modocache
Copy link
Mannequin Author

modocache mannequin commented Mar 26, 2016

No stupid questions--thanks for asking, and thanks for the PR!! Comment here if you find anything.

@swift-ci
Copy link

Comment by Shinichi Goto (JIRA)

Sure!

@modocache
Copy link
Mannequin Author

modocache mannequin commented Mar 27, 2016

Fixed in #82 Thanks, shingt (JIRA User)!

@swift-ci
Copy link

swift-ci commented Apr 2, 2016

Comment by Shinichi Goto (JIRA)

Hi, so I've done investigation on discrepancies and found some in XCTestCase:

//
// expectationWithDescription
//
// swift-corelibs-xctest
public func expectationWithDescription(description: String, file: StaticString = #file, line: UInt = #line) -> XCTestExpectation

// Apple XCTest 
public func expectation(withDescription description: String) -> XCTestExpectation

//
// waitForExpectationsWithTimeout
//
// swift-corelibs-xctest
public func waitForExpectationsWithTimeout(timeout: NSTimeInterval, file: StaticString = #file, line: UInt = #line, handler: XCWaitCompletionHandler?) {

// Apple XCTest 
public func waitForExpectations(withTimeout timeout: NSTimeInterval, handler: XCTest.XCWaitCompletionHandler? = nil)

//
// expectationForNotification
//
// swift-corelibs-xctest
public func expectationForNotification(notificationName: String, object objectToObserve: AnyObject?, handler: XCNotificationExpectationHandler?) -> XCTestExpectation {

// Apple XCTest 
public func expectation(forNotification notificationName: String, object objectToObserve: AnyObject?, handler: XCTest.XCNotificationExpectationHandler? = nil) -> XCTestExpectation

Should I make a PR?

@swift-ci
Copy link

swift-ci commented Apr 4, 2016

Comment by Shinichi Goto (JIRA)

Seems #88 already solved this.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 9, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant