Move connection policy out of ProAccess, keep terminal uploads with their session, and share question interaction and highlight editing operations. Consolidate CPU usage and settings snapshot handling, and remove obsolete terminal selection, theme helpers, and hard-coded latest-schema assertions. Fix draining connection-pool recovery and stale pane upload bindings. Keep screenshot matrices opt-in and retain behavioral migration coverage. Validation: 2468 macOS tests passed serially, 31 iOS tests passed, and both SSH forwarding regressions passed against the local OpenSSH fixture. Both app builds, Swift formatting, AppStrings, and Chinese localization checks passed. Parallel test runs still exhibit intermittent timeouts.
29 lines
1.3 KiB
Swift
29 lines
1.3 KiB
Swift
import TermindDomain
|
|
import Testing
|
|
|
|
@Suite
|
|
nonisolated struct MultiConnectionPolicyTests {
|
|
@Test(arguments: SFTPConcurrencyStrategy.allCases)
|
|
func restrictingConnectionsPreservesSavedStrategyAndTransferLimits(_ strategy: SFTPConcurrencyStrategy) {
|
|
let saved = SFTPPreferences(globalLimit: 80, perHostLimit: 40, strategy: strategy)
|
|
let restricted = MultiConnectionPolicy(allowsMultipleConnections: false)
|
|
#expect(
|
|
restricted.sftpPreferences(saved)
|
|
== SFTPPreferences(globalLimit: 80, perHostLimit: 40, strategy: .channelsOnly))
|
|
#expect(restricted.forwardingConnections(8) == 1)
|
|
#expect(saved.strategy == strategy)
|
|
|
|
let enabled = MultiConnectionPolicy(allowsMultipleConnections: true)
|
|
#expect(enabled.sftpPreferences(saved) == saved)
|
|
#expect(enabled.forwardingConnections(8) == 8)
|
|
}
|
|
|
|
@Test(arguments: [-5, 0, 1, 8, 64, 100])
|
|
func enabledForwardingStillEnforcesTransportLimits(_ saved: Int) {
|
|
let policy = MultiConnectionPolicy(allowsMultipleConnections: true)
|
|
let effective = policy.forwardingConnections(saved)
|
|
#expect(Host.portForwardingMaxConnectionsRange.contains(effective))
|
|
if Host.portForwardingMaxConnectionsRange.contains(saved) { #expect(effective == saved) }
|
|
}
|
|
}
|