@@ -39,7 +39,7 @@ public extension XCTestCase {
39
39
/// between these environments. To ensure compatibility of tests between
40
40
/// swift-corelibs-xctest and Apple XCTest, it is not recommended to pass
41
41
/// explicit values for `file` and `line`.
42
- func expectation( description: String , file: StaticString = #file, line: UInt = #line) -> XCTestExpectation {
42
+ @ discardableResult func expectation( description: String , file: StaticString = #file, line: UInt = #line) -> XCTestExpectation {
43
43
let expectation = XCTestExpectation (
44
44
description: description,
45
45
file: file,
@@ -164,7 +164,7 @@ public extension XCTestCase {
164
164
/// notification is observed. It will not be invoked on timeout. Use the
165
165
/// handler to further investigate if the notification fulfills the
166
166
/// expectation.
167
- func expectation( forNotification notificationName: String , object objectToObserve: AnyObject ? , handler: XCNotificationExpectationHandler ? = nil ) -> XCTestExpectation {
167
+ @ discardableResult func expectation( forNotification notificationName: String , object objectToObserve: AnyObject ? , handler: XCNotificationExpectationHandler ? = nil ) -> XCTestExpectation {
168
168
let objectDescription = objectToObserve == nil ? " any object " : " \( objectToObserve!) "
169
169
let expectation = self . expectation ( description: " Expect notification ' \( notificationName) ' from " + objectDescription)
170
170
// Start observing the notification with specified name and object.
@@ -226,7 +226,7 @@ public extension XCTestCase {
226
226
/// first successful evaluation will fulfill the expectation. If provided,
227
227
/// the handler can override that behavior which leaves the caller
228
228
/// responsible for fulfilling the expectation.
229
- func expectation( for predicate: NSPredicate , evaluatedWith object: AnyObject , file: StaticString = #file, line: UInt = #line, handler: XCPredicateExpectationHandler ? = nil ) -> XCTestExpectation {
229
+ @ discardableResult func expectation( for predicate: NSPredicate , evaluatedWith object: AnyObject , file: StaticString = #file, line: UInt = #line, handler: XCPredicateExpectationHandler ? = nil ) -> XCTestExpectation {
230
230
let expectation = XCPredicateExpectation (
231
231
predicate: predicate,
232
232
object: object,
0 commit comments