Import System package when available (#34)

* Import System package when available

* Add isResourceTemporarilyUnavailable helper method to reduce number of imports of System / SystemPackage
This commit is contained in:
Mattt 2025-03-31 05:30:45 -07:00 • committed by GitHub
commit d55140bc46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 42 additions and 9 deletions

View file

@ -1,10 +1,15 @@
import Foundation
import Logging
import SystemPackage
import Testing
@testable import MCP
#if canImport(System)
import System
#else
@preconcurrency import SystemPackage
#endif
@Suite("Roundtrip Tests")
struct RoundtripTests {
@Test(

View file

@ -1,9 +1,14 @@
import Foundation
import SystemPackage
import Testing
@testable import MCP
#if canImport(System)
import System
#else
@preconcurrency import SystemPackage
#endif
@Suite("Stdio Transport Tests")
struct StdioTransportTests {
@Test("Connection")