Skip to content

Commit eaff0f1

Browse files
committed
Fix formatting
1 parent 5a5dce7 commit eaff0f1

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

Sources/WASI/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ add_wasmkit_library(WASI
99
FileSystem.swift
1010
GuestMemorySupport.swift
1111
Clock.swift
12+
Poll.swift
1213
RandomBufferGenerator.swift
1314
WASI.swift
1415
)

Sources/WASI/Poll.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1+
import SystemPackage
2+
13
#if canImport(Darwin)
2-
import Darwin
4+
import Darwin
35
#elseif canImport(Glibc)
4-
import Glibc
6+
import Glibc
57
#elseif canImport(Musl)
6-
import Musl
8+
import Musl
79
#elseif canImport(Android)
8-
import Android
10+
import Android
911
#else
10-
#error("Unsupported Platform")
12+
#error("Unsupported Platform")
1113
#endif
1214

13-
import SystemPackage
14-
1515
extension FdTable {
1616
func fileDescriptor(fd: WASIAbi.Fd) throws -> FileDescriptor {
17-
guard case let .file(entry) = self[fd], let fd = (entry as? FdWASIEntry)?.fd else {
17+
guard case let .file(entry) = self[fd], let fd = (entry as? FdWASIEntry)?.fd else {
1818
throw WASIAbi.Errno.EBADF
1919
}
2020

Tests/WASITests/WASITests.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,10 @@ final class WASITests: XCTestCase {
173173
XCTAssertEqual(pointer.offset, eventOffset)
174174
XCTAssertEqual(WASIAbi.Event.readFromGuest(&pointer), event)
175175
XCTAssertEqual(pointer.offset, finalOffset)
176-
XCTAssertTrue(try ContinuousClock().measure {
177-
let clockPointer = UnsafeGuestBufferPointer<WASIAbi.Subscription>(baseAddress: .init(memorySpace: memory, offset: clockOffset), count: 1)
178-
XCTAssertEqual(try WASIBridgeToHost().poll_oneoff(subscriptions: clockPointer, events: .init(baseAddress: .init(memorySpace: memory, offset: finalOffset), count: 1)), 1)
179-
} > .nanoseconds(timeout))
176+
XCTAssertTrue(
177+
try ContinuousClock().measure {
178+
let clockPointer = UnsafeGuestBufferPointer<WASIAbi.Subscription>(baseAddress: .init(memorySpace: memory, offset: clockOffset), count: 1)
179+
XCTAssertEqual(try WASIBridgeToHost().poll_oneoff(subscriptions: clockPointer, events: .init(baseAddress: .init(memorySpace: memory, offset: finalOffset), count: 1)), 1)
180+
} > .nanoseconds(timeout))
180181
}
181182
}

0 commit comments

Comments
 (0)