-
Notifications
You must be signed in to change notification settings - Fork 0
Use built-in swift-testing for Xcode 16
#49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
299cdfd
27a5073
c27e4de
d8f6310
6f09558
5d992ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,7 @@ import FoundationNetworking | |||||||
|
|
||||||||
| // based on https://github.com/417-72KI/MultipartFormDataParser/blob/main/Tests/MultipartFormDataParserTests/StubURLProtocol.swift | ||||||||
| final class StubURLProtocol: URLProtocol { | ||||||||
|
||||||||
| final class StubURLProtocol: URLProtocol { | |
| final class StubURLProtocol: URLProtocol { | |
| @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,39 @@ | ||||||
| import Foundation | ||||||
|
|
||||||
| #if canImport(os) | ||||||
| import os | ||||||
|
|
||||||
| final class Lock<State: Sendable>: Sendable { | ||||||
| let lock: OSAllocatedUnfairLock<State> | ||||||
|
Comment on lines
+3
to
+7
|
||||||
|
|
||||||
| init(_ initialState: State) { | ||||||
| lock = .init(initialState: initialState) | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| extension Lock { | ||||||
| @inlinable | ||||||
| func withLock<R: Sendable>(_ body: @Sendable (inout State) throws -> R) rethrows -> R { | ||||||
|
||||||
| func withLock<R: Sendable>(_ body: @Sendable (inout State) throws -> R) rethrows -> R { | |
| func withLock<R>(_ body: @Sendable (inout State) throws -> R) rethrows -> R { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build-time conditional compilation directives like
#if compiler(<6.0)are evaluated during package manifest compilation, not during target compilation. This means the condition will be checked against the Swift compiler version used to build the Package.swift file itself, not the version used to build the targets. This will not achieve the intended backward compatibility. Consider using target-level conditions or separate package manifests for different Swift versions instead.