@@ -333,26 +333,37 @@ protocol MyProtocol {
333333 // PROTO-MEMBER: func protoMember() async -> String{{$}}
334334}
335335
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
337338func nonCompletion( a: Int ) { }
339+ // NON-COMPLETION: func nonCompletion(a: Int) async { }
338340
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
340343func multipleResults( completion: ( Result < String , Error > , Result < String , Error > ) -> Void ) { }
344+ // MULTIPLE-RESULTS: func multipleResults(completion: (Result<String, Error>, Result<String, Error>) -> Void) async { }
341345
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
343348func completionNotLast( completion: ( String ) -> Void , a: Int ) { }
349+ // NOT-LAST: func completionNotLast(completion: (String) -> Void, a: Int) async { }
344350
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
346352func nonVoid( completion: ( String ) -> Void ) -> Int { return 0 }
347353
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
349356func completionNonVoid( completion: ( String ) -> Int ) -> Void { }
357+ // COMPLETION-NON-VOID: func completionNonVoid(completion: (String) -> Int) async -> Void { }
350358
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
352361func alreadyThrows( completion: ( String ) -> Void ) throws { }
353362
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
355365func noParamAutoclosure( completion: @autoclosure ( ) -> Void ) { }
366+ // AUTO-CLOSURE: func noParamAutoclosure(completion: @autoclosure () -> Void) async { }
356367
357368// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix BLOCK-CONVENTION %s
358369func blockConvention( completion: @convention ( block) ( ) -> Void ) { }
0 commit comments