Skip to content

Commit d4251dd

Browse files
fix: Address compilation issues in unit tests that were missed by CI (#3)
* fix: Compiler error in unit tests, missed by CI. * chore: Address swift-format lint issues. * ci: Enable native swift wasm and macos build tests. Note that swift embedded doesn't currently compile, which is tracked by #4.
1 parent b5f34e8 commit d4251dd

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

.github/workflows/pull_request.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ jobs:
1717
name: tests
1818
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
1919
with:
20+
# Runners aren't set up for this currently in GitHub/PassiveLogic
2021
enable_macos_checks: false
22+
2123
linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}, {\"swift_version\": \"5.10.1\"}, {\"swift_version\": \"6.0\"}]"
2224
enable_windows_checks: false
25+
enable_wasm_sdk_build: true
26+
27+
# TODO: Fix swift embedded, see https://github.com/PassiveLogic/swift-dispatch-async/issues/4
28+
enable_embedded_wasm_sdk_build: false
2329

2430
wasm-sdk:
2531
name: WebAssembly SDK

Tests/DispatchAsyncTests/DispatchGroupTests.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ private typealias DispatchQueue = DispatchAsync.DispatchQueue
2727
@Suite("DispatchGroup Tests")
2828
struct DispatchGroupTests {
2929
@Test(arguments: [1000])
30-
@available(macOS 13, iOS 16, tvOS 16, watchOS 9, *)
31-
func dispatchGroupOrderCleanliness(repetitions: Int) async throws {
32-
// Repeating this `repetitions` number of times to help rule out
33-
// edge cases that only show up some of the time
34-
for index in 0 ..< repetitions {
30+
@available(macOS 13, iOS 16, tvOS 16, watchOS 9, *)
31+
func dispatchGroupOrderCleanliness(repetitions: Int) async throws {
32+
// Repeating this `repetitions` number of times to help rule out
33+
// edge cases that only show up some of the time
34+
for index in 0 ..< repetitions {
3535
Task {
3636
actor Result {
3737
private(set) var value = ""
@@ -44,7 +44,7 @@ struct DispatchGroupTests {
4444
let result = Result()
4545

4646
let group = DispatchGroup()
47-
await result.append(value: "|🔵\(iteration)")
47+
await result.append(value: "|🔵\(index)")
4848

4949
group.enter()
5050
Task {
@@ -67,7 +67,7 @@ struct DispatchGroupTests {
6767
await withCheckedContinuation { continuation in
6868
group.notify(queue: .main) {
6969
Task {
70-
await result.append(value: "🟢\(iteration)=")
70+
await result.append(value: "🟢\(index)=")
7171
continuation.resume()
7272
}
7373
}
@@ -115,7 +115,7 @@ struct DispatchGroupTests {
115115
/// ```
116116
///
117117
/// ```
118-
/// // BAD! (green globe comes before a purle one)
118+
/// // BAD! (green globe comes before a purple one)
119119
/// |🔵42🟣/🟣^🟢42🟣\=
120120
/// ```
121121
///

0 commit comments

Comments
 (0)