File tree Expand file tree Collapse file tree
swift/CascadeFileProvideriOS/Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,9 +40,13 @@ final class CascadeIntegrationTests: XCTestCase {
4040 let node = try await CascadeNode ( configDir: configDir)
4141 try await node. start ( )
4242
43- XCTAssertThrowsError ( try await node. readFile ( path: " /local/absent.txt " ) ) { error in
44- // The FFI maps an engine error onto CascadeError; the read of a
45- // missing file must surface an error, not an empty body or a crash.
43+ // XCTAssertThrowsError's autoclosure cannot hold `await`, so drive the
44+ // async throw by hand. The FFI maps an engine error onto CascadeError;
45+ // the read of a missing file must surface an error, not an empty body.
46+ do {
47+ _ = try await node. readFile ( path: " /local/absent.txt " )
48+ XCTFail ( " reading a missing file should throw " )
49+ } catch {
4650 XCTAssertTrue ( error is CascadeError , " missing file is a CascadeError: \( error) " )
4751 }
4852 }
You can’t perform that action at this time.
0 commit comments