11
11
// RUN: %target-build-swift -Xfrontend -validate-tbd-against-ir=all -target %target-cpu-apple-macosx13.0 -parse-as-library -lLibrary -module-name main -I %t -L %t %t/main.swift -o %t/a.out
12
12
13
13
// RUN: %target-codesign %t/a.out
14
- // RUN: %target-run %t/a.out
14
+ // RUN: %target-run %t/a.out | %FileCheck %s
15
15
16
16
//--- library.swift
17
17
import Distributed
18
18
19
- //public protocol NormalProtocol {
20
- // func NORMAL() async -> Int
21
- //}
22
-
23
19
public protocol SimpleProtocol : DistributedActor
24
20
where ActorSystem == LocalTestingDistributedActorSystem {
25
21
@@ -33,35 +29,26 @@ public protocol SimpleProtocol: DistributedActor
33
29
import Distributed
34
30
import Library
35
31
36
- //actor NormalActor: NormalProtocol {
37
- // func NORMAL() async -> Int { 1 }
38
- //}
39
-
40
32
public distributed actor SimpleActor : SimpleProtocol {
41
- public distributed func test( ) -> Int { 1 }
42
- }
43
-
44
- // Passes
45
- public func makeFromPass< Act: DistributedActor > ( _ act: Act ) {
46
- print ( act. id)
33
+ public distributed func test( ) -> Int {
34
+ print ( " SimpleActor.test " )
35
+ return 1
36
+ }
47
37
}
48
38
49
- // Fails
50
39
public func makeFromFail< Act: SimpleProtocol > ( _ act: Act ) async {
51
40
print ( act. id)
52
- try ! await print ( act. test ( ) )
41
+ try ! await print ( " act.test() = \( act. test ( ) ) " )
42
+ // CHECK: SimpleActor.test
43
+ // CHECK: act.test() = 1
53
44
}
54
45
55
46
@main
56
47
struct TestSwiftFrameworkTests {
57
48
static func main( ) async {
58
49
let system = LocalTestingDistributedActorSystem ( )
59
50
60
- // let norm = NormalActor()
61
-
62
51
let simpleActor = SimpleActor ( actorSystem: system)
63
- // makeFromPass(simpleActor)
64
-
65
52
await makeFromFail ( simpleActor)
66
53
}
67
54
}
0 commit comments