Skip to content

Commit 8e7246e

Browse files
committed
ifed out embedded and swift 6 only test case
1 parent fe99cb9 commit 8e7246e

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Sources/Elementary/ServerSupport/SendOnceBox.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if swift(>=6.0)
1+
#if swift(>=6.0) && !hasFeature(Embedded)
22
import Synchronization
33

44
@available(macOS 15.0, *)

Sources/Elementary/ServerSupport/SendableAnyHTMLBox.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if !hasFeature(Embedded)
12
/// A wrapper around an `any HTML` value that can be safely sent once.
23
///
34
/// Note: For non-sendable values, this will only allow the value to be taken only once.
@@ -42,3 +43,4 @@ public struct _SendableAnyHTMLBox: Sendable {
4243
}
4344
#endif
4445
}
46+
#endif

Tests/ElementaryTests/SendableAnyHTMLBox.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ final class SendOnceHTMLValueTests: XCTestCase {
1010
XCTAssertNotNil(box.tryTake())
1111
}
1212

13+
#if swift(>=6.0)
1314
func testHoldsNonSendable() {
1415
let html = MyComponent()
1516
let box = _SendableAnyHTMLBox(html)
1617
XCTAssertNotNil(box.tryTake())
1718
XCTAssertNil(box.tryTake())
1819
}
20+
#endif
1921
}
2022

2123
class NonSendable {

0 commit comments

Comments
 (0)