Skip to content

Commit 1a3e260

Browse files
committed
Use swift-testing to test compatibility adaptors
1 parent 1b73236 commit 1a3e260

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
11
#if canImport(System) && canImport(SystemPackage)
22

3-
import XCTest
3+
import Testing
44

55
import SystemPackage
66
import System
77

88
import SystemCompatibilityAdaptors
99

10-
final class SystemCompatibilityAdaptorTests: XCTestCase {
10+
@Suite("CompatibilityAdaptors")
11+
private struct CompatibilityAdaptorTests {
1112

12-
func testFilePathAdaptor() {
13+
@available(System 0.0.2, *)
14+
@Test
15+
func filePathAdaptor() throws {
1316
let fp = SystemPackage.FilePath("/bar")
1417

1518
let sfp = System.FilePath(converting: fp)
1619

1720
// If we had access to the underlying array as API, this would look less silly
18-
XCTAssertEqual(fp, SystemPackage.FilePath(converting: sfp))
21+
#expect(fp == SystemPackage.FilePath(converting: sfp))
1922
}
2023

21-
func testFileDescriptorAdaptor() throws {
24+
@available(System 0.0.1, *)
25+
@Test
26+
func fileDescriptorAdaptor() throws {
2227
let fd = try SystemPackage.FileDescriptor.standardInput.duplicate()
2328

2429
let sfd: System.FileDescriptor = System.FileDescriptor(converting: fd)
2530

26-
print(fd.rawValue)
27-
XCTAssertEqual(fd.rawValue, sfd.rawValue)
31+
#expect(fd.rawValue == sfd.rawValue)
2832
}
2933
}
3034
#endif // canImport(System) && canImport(SystemPackage)

0 commit comments

Comments
 (0)