@@ -333,26 +333,37 @@ protocol MyProtocol {
333
333
// PROTO-MEMBER: func protoMember() async -> String{{$}}
334
334
}
335
335
336
- // RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1
336
+ // RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+2):1
337
+ // RUN: %refactor -convert-to-async -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=NON-COMPLETION %s
337
338
func nonCompletion( a: Int ) { }
339
+ // NON-COMPLETION: func nonCompletion(a: Int) async { }
338
340
339
- // RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1
341
+ // RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+2):1
342
+ // RUN: %refactor -convert-to-async -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=MULTIPLE-RESULTS %s
340
343
func multipleResults( completion: ( Result < String , Error > , Result < String , Error > ) -> Void ) { }
344
+ // MULTIPLE-RESULTS: func multipleResults(completion: (Result<String, Error>, Result<String, Error>) -> Void) async { }
341
345
342
- // RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1
346
+ // RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+2):1
347
+ // RUN: %refactor -convert-to-async -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=NOT-LAST %s
343
348
func completionNotLast( completion: ( String ) -> Void , a: Int ) { }
349
+ // NOT-LAST: func completionNotLast(completion: (String) -> Void, a: Int) async { }
344
350
345
- // RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+1 ):1
351
+ // RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+2 ):1
346
352
func nonVoid( completion: ( String ) -> Void ) -> Int { return 0 }
347
353
348
- // RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1
354
+ // RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+2):1
355
+ // RUN: %refactor -convert-to-async -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=COMPLETION-NON-VOID %s
349
356
func completionNonVoid( completion: ( String ) -> Int ) -> Void { }
357
+ // COMPLETION-NON-VOID: func completionNonVoid(completion: (String) -> Int) async -> Void { }
350
358
351
- // RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1
359
+ // RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+2):1
360
+ // RUN: %refactor -convert-to-async -dump-text -source-filename %s -pos=%(line+1):1
352
361
func alreadyThrows( completion: ( String ) -> Void ) throws { }
353
362
354
- // RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1
363
+ // RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+2):1
364
+ // RUN: %refactor -convert-to-async -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=AUTO-CLOSURE %s
355
365
func noParamAutoclosure( completion: @autoclosure ( ) -> Void ) { }
366
+ // AUTO-CLOSURE: func noParamAutoclosure(completion: @autoclosure () -> Void) async { }
356
367
357
368
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix BLOCK-CONVENTION %s
358
369
func blockConvention( completion: @convention ( block) ( ) -> Void ) { }
0 commit comments