Skip to content

Commit 6a02a0b

Browse files
committed
Fix up names of some Foundation API which has changed names
1 parent ab3a2d9 commit 6a02a0b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/XCTest/PrintObserver.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ internal class PrintObserver: XCTestObservation {
2323
func testBundleWillStart(_ testBundle: NSBundle) {}
2424

2525
func testSuiteWillStart(_ testSuite: XCTestSuite) {
26-
printAndFlush("Test Suite '\(testSuite.name)' started at \(dateFormatter.stringFromDate(testSuite.testRun!.startDate!))")
26+
printAndFlush("Test Suite '\(testSuite.name)' started at \(dateFormatter.string(from: testSuite.testRun!.startDate!))")
2727
}
2828

2929
func testCaseWillStart(_ testCase: XCTestCase) {
30-
printAndFlush("Test Case '\(testCase.name)' started at \(dateFormatter.stringFromDate(testCase.testRun!.startDate!))")
30+
printAndFlush("Test Case '\(testCase.name)' started at \(dateFormatter.string(from: testCase.testRun!.startDate!))")
3131
}
3232

3333
func testCase(_ testCase: XCTestCase, didFailWithDescription description: String, inFile filePath: String?, atLine lineNumber: UInt) {
@@ -47,7 +47,7 @@ internal class PrintObserver: XCTestObservation {
4747
func testSuiteDidFinish(_ testSuite: XCTestSuite) {
4848
let testRun = testSuite.testRun!
4949
let verb = testRun.hasSucceeded ? "passed" : "failed"
50-
printAndFlush("Test Suite '\(testSuite.name)' \(verb) at \(dateFormatter.stringFromDate(testRun.stopDate!))")
50+
printAndFlush("Test Suite '\(testSuite.name)' \(verb) at \(dateFormatter.string(from: testRun.stopDate!))")
5151

5252
let tests = testRun.executionCount == 1 ? "test" : "tests"
5353
let failures = testRun.totalFailureCount == 1 ? "failure" : "failures"

Sources/XCTest/XCTestRun.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class XCTestRun {
3434
/// when it was stopped.
3535
public var totalDuration: NSTimeInterval {
3636
if let stop = stopDate, start = startDate {
37-
return stop.timeIntervalSinceDate(start)
37+
return stop.timeIntervalSince(start)
3838
} else {
3939
return 0.0
4040
}

0 commit comments

Comments
 (0)