File tree 3 files changed +58
-0
lines changed
Testing.docc/AvailabilityStubs
3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -375,6 +375,7 @@ public macro require<R>(
375
375
/// ``expect(throws:_:sourceLocation:performing:)-1hfms`` instead. If the thrown
376
376
/// error need only equal another instance of [`Error`](https://developer.apple.com/documentation/swift/error),
377
377
/// use ``expect(throws:_:sourceLocation:performing:)-7du1h`` instead.
378
+ @available ( * , deprecated, message: " Examine the result of '#expect(throws:)' instead. " )
378
379
@discardableResult
379
380
@freestanding ( expression) public macro expect< R> (
380
381
_ comment: @autoclosure ( ) -> Comment ? = nil ,
@@ -426,6 +427,7 @@ public macro require<R>(
426
427
///
427
428
/// If `expression` should _never_ throw, simply invoke the code without using
428
429
/// this macro. The test will then fail if an error is thrown.
430
+ @available ( * , deprecated, message: " Examine the result of '#require(throws:)' instead. " )
429
431
@discardableResult
430
432
@freestanding ( expression) public macro require< R> (
431
433
_ comment: @autoclosure ( ) -> Comment ? = nil ,
Original file line number Diff line number Diff line change
1
+ # `` expect(_:sourceLocation:performing:throws:) ``
2
+
3
+ <!--
4
+ This source file is part of the Swift.org open source project
5
+
6
+ Copyright (c) 2023 Apple Inc. and the Swift project authors
7
+ Licensed under Apache License v2.0 with Runtime Library Exception
8
+
9
+ See https://swift.org/LICENSE.txt for license information
10
+ See https://swift.org/CONTRIBUTORS.txt for Swift project authors
11
+ -->
12
+
13
+ @Metadata {
14
+ @Available (Swift, introduced: 6.0, deprecated: 999.0)
15
+ @Available (Xcode, introduced: 16.0, deprecated: 999.0)
16
+ }
17
+
18
+ @DeprecationSummary {
19
+ Examine the result of `` expect(throws:_:sourceLocation:performing:)-7du1h `` or
20
+ `` expect(throws:_:sourceLocation:performing:)-1hfms `` instead:
21
+
22
+ ``` swift
23
+ let error = #expect (throws : FoodTruckError.self ) {
24
+ ...
25
+ }
26
+ #expect (error? .napkinCount == 0 )
27
+ ```
28
+ }
Original file line number Diff line number Diff line change
1
+ # `` require(_:sourceLocation:performing:throws:) ``
2
+
3
+ <!--
4
+ This source file is part of the Swift.org open source project
5
+
6
+ Copyright (c) 2023 Apple Inc. and the Swift project authors
7
+ Licensed under Apache License v2.0 with Runtime Library Exception
8
+
9
+ See https://swift.org/LICENSE.txt for license information
10
+ See https://swift.org/CONTRIBUTORS.txt for Swift project authors
11
+ -->
12
+
13
+ @Metadata {
14
+ @Available (Swift, introduced: 6.0, deprecated: 999.0)
15
+ @Available (Xcode, introduced: 16.0, deprecated: 999.0)
16
+ }
17
+
18
+ @DeprecationSummary {
19
+ Examine the result of `` require(throws:_:sourceLocation:performing:)-7n34r ``
20
+ or `` require(throws:_:sourceLocation:performing:)-4djuw `` instead:
21
+
22
+ ``` swift
23
+ let error = try #require (throws : FoodTruckError.self ) {
24
+ ...
25
+ }
26
+ #expect (error.napkinCount == 0 )
27
+ ```
28
+ }
You can’t perform that action at this time.
0 commit comments