Merge pull request #244 from apple/revert-243-revert-241-make-runloopmode-nested
[5.0] Revert "Revert "Convert RunLoopMode to RunLoop.Mode as with Darwin Foundation""
diff --git a/Sources/XCTest/Public/Asynchronous/XCTNSPredicateExpectation.swift b/Sources/XCTest/Public/Asynchronous/XCTNSPredicateExpectation.swift
index eb28ebc..08d0cf2 100644
--- a/Sources/XCTest/Public/Asynchronous/XCTNSPredicateExpectation.swift
+++ b/Sources/XCTest/Public/Asynchronous/XCTNSPredicateExpectation.swift
@@ -95,7 +95,7 @@
}
}
- runLoop.add(timer, forMode: .defaultRunLoopMode)
+ runLoop.add(timer, forMode: .default)
queue.async {
self.timer = timer
}
diff --git a/Sources/XCTest/Public/Asynchronous/XCTWaiter.swift b/Sources/XCTest/Public/Asynchronous/XCTWaiter.swift
index 4c91aff..0a404c5 100644
--- a/Sources/XCTest/Public/Asynchronous/XCTWaiter.swift
+++ b/Sources/XCTest/Public/Asynchronous/XCTWaiter.swift
@@ -362,7 +362,7 @@
let timeIntervalToRun = min(0.1, timeout)
// RunLoop.run(mode:before:) should have @discardableResult <rdar://problem/45371901>
- _ = runLoop.run(mode: .defaultRunLoopMode, before: Date(timeIntervalSinceNow: timeIntervalToRun))
+ _ = runLoop.run(mode: .default, before: Date(timeIntervalSinceNow: timeIntervalToRun))
}
func cancelPrimitiveWait() {
diff --git a/Tests/Functional/Asynchronous/Expectations/main.swift b/Tests/Functional/Asynchronous/Expectations/main.swift
index 15b332a..878511a 100644
--- a/Tests/Functional/Asynchronous/Expectations/main.swift
+++ b/Tests/Functional/Asynchronous/Expectations/main.swift
@@ -47,7 +47,7 @@
let timer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: false) { _ in
expectation.fulfill()
}
- RunLoop.current.add(timer, forMode: .defaultRunLoopMode)
+ RunLoop.current.add(timer, forMode: .default)
waitForExpectations(timeout: 1.0)
}
@@ -59,7 +59,7 @@
let timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: false) { _ in
expectation.fulfill()
}
- RunLoop.current.add(timer, forMode: .defaultRunLoopMode)
+ RunLoop.current.add(timer, forMode: .default)
waitForExpectations(timeout: 0.1)
}