Skip to content

Commit a3097cb

Browse files
committed
Additional ifdefing out non windows targets for sequence diagram testing and more formatting fixes
1 parent 5032560 commit a3097cb

File tree

6 files changed

+44
-26
lines changed

6 files changed

+44
-26
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ let package = Package(
4848
dependencies: [
4949
.target(name: "AsyncAlgorithms"),
5050
.target(
51-
name: "AsyncSequenceValidation",
51+
name: "AsyncSequenceValidation",
5252
condition: .when(platforms: [
5353
.macOS,
5454
.iOS,
@@ -63,7 +63,7 @@ let package = Package(
6363
])
6464
),
6565
.target(
66-
name: "AsyncAlgorithms_XCTest",
66+
name: "AsyncAlgorithms_XCTest",
6767
condition: .when(platforms: [
6868
.macOS,
6969
.iOS,

[email protected]

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,36 @@ let package = Package(
4949
name: "AsyncAlgorithmsTests",
5050
dependencies: [
5151
.target(name: "AsyncAlgorithms"),
52-
.target(name: "AsyncSequenceValidation", condition: .when(platforms: [
53-
.macOS,
54-
.iOS,
55-
.tvOS,
56-
.watchOS,
57-
.visionOS,
58-
.macCatalyst,
59-
.android,
60-
.linux,
61-
.openbsd,
62-
.wasi
63-
])),
64-
.target(name: "AsyncAlgorithms_XCTest", condition: .when(platforms: [
65-
.macOS,
66-
.iOS,
67-
.tvOS,
68-
.watchOS,
69-
.visionOS,
70-
.macCatalyst,
71-
.android,
72-
.linux,
73-
.openbsd,
74-
.wasi
75-
]))
52+
.target(
53+
name: "AsyncSequenceValidation",
54+
condition: .when(platforms: [
55+
.macOS,
56+
.iOS,
57+
.tvOS,
58+
.watchOS,
59+
.visionOS,
60+
.macCatalyst,
61+
.android,
62+
.linux,
63+
.openbsd,
64+
.wasi
65+
])
66+
),
67+
.target(
68+
name: "AsyncAlgorithms_XCTest",
69+
condition: .when(platforms: [
70+
.macOS,
71+
.iOS,
72+
.tvOS,
73+
.watchOS,
74+
.visionOS,
75+
.macCatalyst,
76+
.android,
77+
.linux,
78+
.openbsd,
79+
.wasi
80+
])
81+
)
7682
],
7783
swiftSettings: availabilityMacros + [
7884
.enableExperimentalFeature("StrictConcurrency=complete")

Tests/AsyncAlgorithmsTests/TestBuffer.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ final class TestBuffer: XCTestCase {
108108
XCTAssertNil(pastFailure)
109109
}
110110

111+
#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread)
111112
func test_given_a_base_sequence_when_bufferingOldest_then_the_policy_is_applied() async {
112113
validate {
113114
"X-12- 34- 5 |"
@@ -171,6 +172,7 @@ final class TestBuffer: XCTestCase {
171172
"X,,,,,,[45^]"
172173
}
173174
}
175+
#endif
174176

175177
func
176178
test_given_a_buffered_with_unbounded_sequence_when_cancelling_consumer_then_the_iteration_finishes_and_the_base_is_cancelled()
@@ -325,11 +327,13 @@ final class TestBuffer: XCTestCase {
325327
await fulfillment(of: [finished], timeout: 1.0)
326328
}
327329

330+
#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread)
328331
func test_given_a_base_sequence_when_bounded_with_limit_0_then_the_policy_is_transparent() async {
329332
validate {
330333
"X-12- 34 -5|"
331334
$0.inputs[0].buffer(policy: .bounded(0))
332335
"X-12- 34 -5|"
333336
}
334337
}
338+
#endif
335339
}

Tests/AsyncAlgorithmsTests/TestDebounce.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import XCTest
1313
import AsyncAlgorithms
1414

1515
final class TestDebounce: XCTestCase {
16+
#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread)
1617
func test_delayingValues() throws {
1718
guard #available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) else {
1819
throw XCTSkip("Skipped due to Clock/Instant/Duration availability")
@@ -67,6 +68,7 @@ final class TestDebounce: XCTestCase {
6768
"----|"
6869
}
6970
}
71+
#endif
7072

7173
func test_Rethrows() async throws {
7274
guard #available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) else {

Tests/AsyncAlgorithmsTests/TestMerge.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ final class TestMerge2: XCTestCase {
170170
XCTAssertEqual(collected.intersection(expected), expected)
171171
}
172172

173+
#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread)
173174
func test_merge_makes_sequence_with_ordered_elements_when_sources_follow_a_timeline() {
174175
validate {
175176
"a-c-e-g-|"
@@ -178,6 +179,7 @@ final class TestMerge2: XCTestCase {
178179
"abcdefgh|"
179180
}
180181
}
182+
#endif
181183

182184
func test_merge_finishes_when_iteration_task_is_cancelled() async {
183185
let source1 = Indefinite(value: "test1")
@@ -508,6 +510,7 @@ final class TestMerge3: XCTestCase {
508510
XCTAssertEqual(collected.intersection(expected), expected)
509511
}
510512

513+
#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread)
511514
func test_merge_makes_sequence_with_ordered_elements_when_sources_follow_a_timeline() {
512515
validate {
513516
"a---e---|"
@@ -517,6 +520,7 @@ final class TestMerge3: XCTestCase {
517520
"abcdefgh|"
518521
}
519522
}
523+
#endif
520524

521525
func test_merge_finishes_when_iteration_task_is_cancelled() async {
522526
let source1 = Indefinite(value: "test1")

Tests/AsyncAlgorithmsTests/TestThrottle.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import XCTest
1313
import AsyncAlgorithms
1414

1515
final class TestThrottle: XCTestCase {
16+
#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread)
1617
func test_rate_0() throws {
1718
guard #available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) else {
1819
throw XCTSkip("Skipped due to Clock/Instant/Duration availability")
@@ -188,4 +189,5 @@ final class TestThrottle: XCTestCase {
188189
"a--d--g--j--[l|]"
189190
}
190191
}
192+
#endif
191193
}

0 commit comments

Comments
 (0)