1
- // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -Xfrontend -enable-experimental-distributed -parse-as-library)
1
+ // RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking -Xfrontend -enable-experimental-distributed -parse-as-library) | %FileCheck %s
2
2
3
3
// REQUIRES: executable_test
4
4
// REQUIRES: concurrency
8
8
// UNSUPPORTED: use_os_stdlib
9
9
// UNSUPPORTED: back_deployment_runtime
10
10
11
- import StdlibUnittest
12
11
import _Distributed
13
12
14
- @available ( SwiftStdlib 5 . 5 , * )
15
13
struct ActorAddress : ActorIdentity , CustomStringConvertible {
16
14
let id : String
17
15
var description : Swift . String {
18
16
" ActorAddress(id: \( id) ) "
19
17
}
20
18
}
21
19
22
- @main struct Main {
23
- static func main( ) async {
24
- if #available( SwiftStdlib 5 . 5 , * ) {
25
-
26
- let ActorIdentityTests = TestSuite ( " ActorIdentity " )
27
20
28
- ActorIdentityTests . test ( " equality " ) {
29
- let a = ActorAddress ( id: " a " )
30
- let b = ActorAddress ( id: " b " )
21
+ func equality( ) {
22
+ let a = ActorAddress ( id: " a " )
23
+ let b = ActorAddress ( id: " b " )
31
24
32
- let anyA = AnyActorIdentity ( a)
33
- let anyB = AnyActorIdentity ( b)
25
+ let anyA = AnyActorIdentity ( a)
26
+ let anyB = AnyActorIdentity ( b)
34
27
35
- expectEqual ( a , a )
36
- expectEqual ( anyA, anyA)
28
+ print ( " \( a == a ) " ) // CHECK: true
29
+ print ( " \( anyA == anyA) " ) // CHECK: true
37
30
38
- expectNotEqual ( a , b )
39
- expectNotEqual ( anyA, anyB)
40
- }
31
+ print ( " \( a != b ) " ) // CHECK: true
32
+ print ( " \( anyA != anyB) " ) // CHECK: true
33
+ }
41
34
42
- ActorIdentityTests . test ( " hash " ) {
43
- let a = ActorAddress ( id: " a " )
44
- let b = ActorAddress ( id: " b " )
35
+ func hash( ) {
36
+ let a = ActorAddress ( id: " a " )
37
+ let b = ActorAddress ( id: " b " )
45
38
46
- let anyA = AnyActorIdentity ( a)
47
- let anyB = AnyActorIdentity ( b)
39
+ let anyA = AnyActorIdentity ( a)
40
+ let anyB = AnyActorIdentity ( b)
48
41
49
- expectEqual ( a. hashValue, a. hashValue)
50
- expectEqual ( anyA. hashValue, anyA. hashValue)
42
+ print ( " \( a. hashValue == a. hashValue) " ) // CHECK: true
43
+ print ( " \( anyA. hashValue == anyA. hashValue) " ) // CHECK: true
51
44
52
- expectNotEqual ( a. hashValue, b. hashValue)
53
- expectNotEqual ( anyA. hashValue, anyB. hashValue)
54
- }
55
- }
45
+ print ( " \( a. hashValue != b. hashValue) " ) // CHECK: true
46
+ print ( " \( anyA. hashValue != anyB. hashValue) " ) // CHECK: true
47
+ }
56
48
57
- await runAllTestsAsync ( )
49
+ @main struct Main {
50
+ static func main( ) {
51
+ equality ( )
52
+ hash ( )
58
53
}
59
54
}
0 commit comments