Files
swift-mirror/test/refactoring/ConvertAsync/errors.swift
Ben Barham fabb02100f [Test] Add @escaping to async refactoring tests
The async refactorings ignore whether a completion handler had
`@escaping` or not. In preparation of fixing this, fix up all functions
to have `@escaping` for their completion handler parameter.

Also some small miscellaneous fixes in order to reduce the number of
warnings output on test failures and also the addition of `REQUIRES:
concurrency` on all tests.
2021-07-24 09:53:17 +10:00

22 lines
713 B
Swift

// REQUIRES: concurrency
func simple(completion: @escaping (String?, Error?) -> Void) { }
func mismatches() {
// RUN: not %refactor -convert-call-to-async-alternative -dump-text -source-filename %s -pos=%(line+1):3
simple()
// RUN: not %refactor -convert-call-to-async-alternative -dump-text -source-filename %s -pos=%(line+1):3
simple(10) { res, err in
print("call mismatch")
}
// RUN: not %refactor -convert-call-to-async-alternative -dump-text -source-filename %s -pos=%(line+1):3
simple { res in
print("closure mismatch")
}
}
// RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1
func missingBody(complete: @escaping (Int?, Error?) -> Void)