You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This source file is part of the Swift.org open source project
2
+
//
3
+
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
4
+
// Licensed under Apache License v2.0 with Runtime Library Exception
5
+
//
6
+
// See http://swift.org/LICENSE.txt for license information
7
+
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
8
+
9
+
extensionXCTestCase{
10
+
11
+
/// A class which encapsulates teardown blocks which are registered via the `addTeardownBlock(_:)` method.
12
+
/// Supports async and sync throwing methods.
13
+
finalclassTeardownBlocksState{
14
+
15
+
privatevarwasFinalized=false
16
+
privatevarblocks:[()throws->Void]=[]
17
+
18
+
// We don't want to overload append(_:) below because of how Swift will implicitly promote sync closures to async closures,
19
+
// which can unexpectedly change their semantics in difficult to track down ways.
20
+
//
21
+
// Because of this, we chose the unusual decision to forgo overloading (which is a super sweet language feature <3) to prevent this issue from surprising any contributors to corelibs-xctest
// This time interval is set to a very large value due to their being no real native timeout functionality within corelibs-xctest.
375
+
// With the introduction of async/await support, the framework now relies on XCTestExpectations internally to coordinate the addition async portions of setup and tear down.
376
+
// This time interval is the timeout corelibs-xctest uses with XCTestExpectations.
0 commit comments