Skip to content

Commit ff1dc23

Browse files
authored
Merge pull request #133 from modocache/se-0099
Fix warnings introduced by SE-0099
2 parents fa433b9 + 4d8b501 commit ff1dc23

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Sources/XCTest/Private/TestListing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ extension XCTestSuite: Listable {
6363
}
6464

6565
private var listingName: String {
66-
if let childTestCase = tests.first as? XCTestCase where name == String(childTestCase.dynamicType) {
66+
if let childTestCase = tests.first as? XCTestCase, name == String(childTestCase.dynamicType) {
6767
return "\(moduleName(value: childTestCase)).\(name)"
6868
} else {
6969
return name

Sources/XCTest/Public/XCTestCase+Performance.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public extension XCTestCase {
126126
/// ensure compatibility of tests between swift-corelibs-xctest and Apple
127127
/// XCTest, it is not recommended to pass explicit values for `file` and `line`.
128128
func startMeasuring(file: StaticString = #file, line: UInt = #line) {
129-
guard let performanceMeter = _performanceMeter where !performanceMeter.didFinishMeasuring else {
129+
guard let performanceMeter = _performanceMeter, !performanceMeter.didFinishMeasuring else {
130130
return recordAPIViolation(description: "Cannot start measuring. startMeasuring() is only supported from a block passed to measureMetrics(...).", file: file, line: line)
131131
}
132132
performanceMeter.startMeasuring(file: file, line: line)
@@ -141,7 +141,7 @@ public extension XCTestCase {
141141
/// ensure compatibility of tests between swift-corelibs-xctest and Apple
142142
/// XCTest, it is not recommended to pass explicit values for `file` and `line`.
143143
func stopMeasuring(file: StaticString = #file, line: UInt = #line) {
144-
guard let performanceMeter = _performanceMeter where !performanceMeter.didFinishMeasuring else {
144+
guard let performanceMeter = _performanceMeter, !performanceMeter.didFinishMeasuring else {
145145
return recordAPIViolation(description: "Cannot stop measuring. stopMeasuring() is only supported from a block passed to measureMetrics(...).", file: file, line: line)
146146
}
147147
performanceMeter.stopMeasuring(file: file, line: line)

Sources/XCTest/Public/XCTestRun.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class XCTestRun {
3333
/// The number of seconds that elapsed between when the run was started and
3434
/// when it was stopped.
3535
public var totalDuration: TimeInterval {
36-
if let stop = stopDate, start = startDate {
36+
if let stop = stopDate, let start = startDate {
3737
return stop.timeIntervalSince(start)
3838
} else {
3939
return 0.0

0 commit comments

Comments
 (0)