Skip to content

Commit 2a0ecc6

Browse files
Tests: Fix 6.0 swift-testing compatibility
1 parent 166065f commit 2a0ecc6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Tests/WasmKitTests/ExecutionTests.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,15 @@
7979
let instance = try module.instantiate(store: store, imports: imports)
8080
let _start = try #require(instance.exports[function: "_start"])
8181

82-
guard let trap: Trap = (#expect(throws: Trap.self) { try _start() }) else {
82+
let trap: Trap
83+
do {
84+
let _ = try _start()
85+
#expect((false), "Expected trap")
86+
return
87+
} catch let _trap as Trap {
88+
trap = _trap
89+
} catch {
90+
#expect((false), "Expected trap: \(error)")
8391
return
8492
}
8593
try assertTrap(trap)

0 commit comments

Comments
 (0)