Skip to content

Commit 359a1bf

Browse files
committed
Updated unit tests
1 parent 2f78d78 commit 359a1bf

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Tests/BluetoothLinuxTests/L2CAPTests.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Bluetooth
1111
import BluetoothHCI
1212
import BluetoothGATT
1313
import BluetoothGAP
14+
import SystemPackage
1415
@testable import BluetoothLinux
1516

1617
final class L2CAPTests: XCTestCase {
@@ -49,7 +50,7 @@ final class L2CAPTests: XCTestCase {
4950
while serverSocket.status.accept == false {
5051
try await Task.sleep(nanoseconds: 10_000)
5152
if let error = serverSocket.status.error {
52-
53+
throw error
5354
}
5455
}
5556
let newConnection = try serverSocket.accept()
@@ -126,5 +127,17 @@ final class L2CAPTests: XCTestCase {
126127
logs.append($0)
127128
}
128129
)
130+
try await Task.sleep(nanoseconds: 100_000)
131+
do {
132+
while true {
133+
try server.run()
134+
}
135+
}
136+
catch {
137+
print(error)
138+
}
139+
withExtendedLifetime(server) {
140+
_ = $0
141+
}
129142
}
130143
}

0 commit comments

Comments
 (0)