Skip to content

Fix warnings introduced by SE-0099 #133

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
Jul 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/XCTest/Private/TestListing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extension XCTestSuite: Listable {
}

private var listingName: String {
if let childTestCase = tests.first as? XCTestCase where name == String(childTestCase.dynamicType) {
if let childTestCase = tests.first as? XCTestCase, name == String(childTestCase.dynamicType) {
return "\(moduleName(value: childTestCase)).\(name)"
} else {
return name
Expand Down
4 changes: 2 additions & 2 deletions Sources/XCTest/Public/XCTestCase+Performance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public extension XCTestCase {
/// ensure compatibility of tests between swift-corelibs-xctest and Apple
/// XCTest, it is not recommended to pass explicit values for `file` and `line`.
func startMeasuring(file: StaticString = #file, line: UInt = #line) {
guard let performanceMeter = _performanceMeter where !performanceMeter.didFinishMeasuring else {
guard let performanceMeter = _performanceMeter, !performanceMeter.didFinishMeasuring else {
return recordAPIViolation(description: "Cannot start measuring. startMeasuring() is only supported from a block passed to measureMetrics(...).", file: file, line: line)
}
performanceMeter.startMeasuring(file: file, line: line)
Expand All @@ -141,7 +141,7 @@ public extension XCTestCase {
/// ensure compatibility of tests between swift-corelibs-xctest and Apple
/// XCTest, it is not recommended to pass explicit values for `file` and `line`.
func stopMeasuring(file: StaticString = #file, line: UInt = #line) {
guard let performanceMeter = _performanceMeter where !performanceMeter.didFinishMeasuring else {
guard let performanceMeter = _performanceMeter, !performanceMeter.didFinishMeasuring else {
return recordAPIViolation(description: "Cannot stop measuring. stopMeasuring() is only supported from a block passed to measureMetrics(...).", file: file, line: line)
}
performanceMeter.stopMeasuring(file: file, line: line)
Expand Down
2 changes: 1 addition & 1 deletion Sources/XCTest/Public/XCTestRun.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class XCTestRun {
/// The number of seconds that elapsed between when the run was started and
/// when it was stopped.
public var totalDuration: TimeInterval {
if let stop = stopDate, start = startDate {
if let stop = stopDate, let start = startDate {
return stop.timeIntervalSince(start)
} else {
return 0.0
Expand Down