Skip to content

Commit f5551f3

Browse files
committed
Add ObjC interface test for effectful property imports
1 parent ab47660 commit f5551f3

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// RUN: %empty-directory(%t)
2+
3+
// RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk) -print-module -source-filename %s -module-to-print=EffectfulProperties -function-definitions=false -enable-experimental-concurrency > %t/EffectfulProperties.printed.txt
4+
// RUN: %FileCheck -input-file %t/EffectfulProperties.printed.txt %s
5+
6+
// REQUIRES: objc_interop
7+
// REQUIRES: concurrency
8+
9+
// CHECK-LABEL: class EffProps : NSObject {
10+
// CHECK: func getDogWithCompletion(_ completionHandler: @escaping (NSObject) -> Void)
11+
// CHECK: var doggo: NSObject { get async }
12+
13+
// CHECK: func obtainCat(_ completionHandler: @escaping (NSObject?, Error?) -> Void)
14+
// CHECK-NEXT: var catto: NSObject? { get async throws }
15+
16+
// CHECK: func checkAvailability(completionHandler: @escaping (Bool) -> Void)
17+
// CHECK-NEXT: var available: Bool { get async }
18+
// CHECK-NEXT: @available(swift, obsoleted: 3, renamed: "checkAvailability(completionHandler:)")
19+
// CHECK-NEXT: func checkAvailabilityWithCompletionHandler(_ completionHandler: @escaping (Bool) -> Void)
20+
21+
// CHECK: func returnNothing(completion completionHandler: @escaping () -> Void)
22+
// CHECK-NEXT: var touch: Void { get async }
23+
// CHECK-NEXT: @available(swift, obsoleted: 3, renamed: "returnNothing(completion:)")
24+
// CHECK-NEXT: func returnNothingWithCompletion(_ completionHandler: @escaping () -> Void)
25+
26+
// CHECK: func nullableHandler(_ completion: ((String) -> Void)? = nil)
27+
// CHECK-NEXT: var fromNullableHandler: String { get async }
28+
29+
// CHECK: func getMainDog(_ completion: @escaping @MainActor (String) -> Void)
30+
// CHECK-NEXT: var mainDogProp: String { get async }
31+
32+
// CHECK: @completionHandlerAsync("regularMainDog()", completionHandleIndex: 0)
33+
// CHECK-NEXT: func regularMainDog(_ completion: @escaping @MainActor (String) -> Void)
34+
// CHECK-NEXT: func regularMainDog() async -> String
35+
// CHECK: }
36+
37+
// CHECK-LABEL: class NotEffProps : NSObject {
38+
// CHECK-NOT: var
39+
// CHECK: func EffPropGetDogWithCompletion(_ s: OpaquePointer, _ myBlock: @escaping (NSObject) -> Void) -> Double

0 commit comments

Comments
 (0)