Skip to content

Commit 407bd53

Browse files
committed
[Distributed] speed-up test StdlibUnittest
1 parent 6301909 commit 407bd53

File tree

1 file changed

+25
-30
lines changed

1 file changed

+25
-30
lines changed
Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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
22

33
// REQUIRES: executable_test
44
// REQUIRES: concurrency
@@ -8,52 +8,47 @@
88
// UNSUPPORTED: use_os_stdlib
99
// UNSUPPORTED: back_deployment_runtime
1010

11-
import StdlibUnittest
1211
import _Distributed
1312

14-
@available(SwiftStdlib 5.5, *)
1513
struct ActorAddress: ActorIdentity, CustomStringConvertible {
1614
let id: String
1715
var description: Swift.String {
1816
"ActorAddress(id: \(id))"
1917
}
2018
}
2119

22-
@main struct Main {
23-
static func main() async {
24-
if #available(SwiftStdlib 5.5, *) {
25-
26-
let ActorIdentityTests = TestSuite("ActorIdentity")
2720

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")
3124

32-
let anyA = AnyActorIdentity(a)
33-
let anyB = AnyActorIdentity(b)
25+
let anyA = AnyActorIdentity(a)
26+
let anyB = AnyActorIdentity(b)
3427

35-
expectEqual(a, a)
36-
expectEqual(anyA, anyA)
28+
print("\(a == a)") // CHECK: true
29+
print("\(anyA == anyA)") // CHECK: true
3730

38-
expectNotEqual(a, b)
39-
expectNotEqual(anyA, anyB)
40-
}
31+
print("\(a != b)") // CHECK: true
32+
print("\(anyA != anyB)") // CHECK: true
33+
}
4134

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")
4538

46-
let anyA = AnyActorIdentity(a)
47-
let anyB = AnyActorIdentity(b)
39+
let anyA = AnyActorIdentity(a)
40+
let anyB = AnyActorIdentity(b)
4841

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
5144

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+
}
5648

57-
await runAllTestsAsync()
49+
@main struct Main {
50+
static func main() {
51+
equality()
52+
hash()
5853
}
5954
}

0 commit comments

Comments
 (0)