Avatar
expectation 要らずで最高ですね。
3:00 AM
timeout が問題か。
3:01 AM
XCTestCase のプロパティで設定とかかなぁ。ちょっと気持ち悪いけど。
3:02 AM
func testFoo() async { timeout = 3.0 XCTAssertEqual(await foo(), 42) } (edited)
3:06 AM
throws async なら↓みたいな感じ? func testFoo() async { timeout = 3.0 do { XCTAssertEqual(await try foo(...), ...) XCTAssertEqual(await try foo(...), ...) XCTAssertEqual(await try foo(...), ...) } catch { XCTFail(...) } do { // error cases _ = await try foo(...) XCTFail(...) } catch error as FooError { XCTAssertEqual(error.bar, ...) } catch { XCTFail(...) } )