23
23
@freestanding ( expression) public macro expect(
24
24
_ condition: Bool ,
25
25
_ comment: @autoclosure ( ) -> Comment ? = nil ,
26
- sourceLocation: SourceLocation = SourceLocation ( )
26
+ sourceLocation: SourceLocation = #_sourceLocation
27
27
) = #externalMacro( module: " TestingMacros " , type: " ExpectMacro " )
28
28
29
29
/// Check that an expectation has passed after a condition has been evaluated
44
44
@freestanding ( expression) public macro require(
45
45
_ condition: Bool ,
46
46
_ comment: @autoclosure ( ) -> Comment ? = nil ,
47
- sourceLocation: SourceLocation = SourceLocation ( )
47
+ sourceLocation: SourceLocation = #_sourceLocation
48
48
) = #externalMacro( module: " TestingMacros " , type: " RequireMacro " )
49
49
50
50
// MARK: - Optional checking
68
68
@freestanding ( expression) public macro require< T> (
69
69
_ optionalValue: T ? ,
70
70
_ comment: @autoclosure ( ) -> Comment ? = nil ,
71
- sourceLocation: SourceLocation = SourceLocation ( )
71
+ sourceLocation: SourceLocation = #_sourceLocation
72
72
) -> T = #externalMacro( module: " TestingMacros " , type: " RequireMacro " )
73
73
74
74
/// Unwrap an optional boolean value or, if it is `nil`, fail and throw an
98
98
public macro require(
99
99
_ optionalValue: Bool ? ,
100
100
_ comment: @autoclosure ( ) -> Comment ? = nil ,
101
- sourceLocation: SourceLocation = SourceLocation ( )
101
+ sourceLocation: SourceLocation = #_sourceLocation
102
102
) -> Bool = #externalMacro( module: " TestingMacros " , type: " AmbiguousRequireMacro " )
103
103
104
104
// MARK: - Matching errors by type
@@ -136,7 +136,7 @@ public macro require(
136
136
@freestanding ( expression) public macro expect< E, R> (
137
137
throws errorType: E . Type ,
138
138
_ comment: @autoclosure ( ) -> Comment ? = nil ,
139
- sourceLocation: SourceLocation = SourceLocation ( ) ,
139
+ sourceLocation: SourceLocation = #_sourceLocation ,
140
140
performing expression: ( ) async throws -> R
141
141
) = #externalMacro( module: " TestingMacros " , type: " ExpectMacro " ) where E: Error
142
142
@@ -175,7 +175,7 @@ public macro require(
175
175
@freestanding ( expression) public macro expect< R> (
176
176
throws _: Never . Type ,
177
177
_ comment: @autoclosure ( ) -> Comment ? = nil ,
178
- sourceLocation: SourceLocation = SourceLocation ( ) ,
178
+ sourceLocation: SourceLocation = #_sourceLocation ,
179
179
performing expression: ( ) async throws -> R
180
180
) = #externalMacro( module: " TestingMacros " , type: " ExpectMacro " )
181
181
@@ -217,7 +217,7 @@ public macro require(
217
217
@freestanding ( expression) public macro require< E, R> (
218
218
throws errorType: E . Type ,
219
219
_ comment: @autoclosure ( ) -> Comment ? = nil ,
220
- sourceLocation: SourceLocation = SourceLocation ( ) ,
220
+ sourceLocation: SourceLocation = #_sourceLocation ,
221
221
performing expression: ( ) async throws -> R
222
222
) = #externalMacro( module: " TestingMacros " , type: " RequireMacro " ) where E: Error
223
223
@@ -236,7 +236,7 @@ public macro require(
236
236
@freestanding ( expression) public macro require< R> (
237
237
throws _: Never . Type ,
238
238
_ comment: @autoclosure ( ) -> Comment ? = nil ,
239
- sourceLocation: SourceLocation = SourceLocation ( ) ,
239
+ sourceLocation: SourceLocation = #_sourceLocation ,
240
240
performing expression: ( ) async throws -> R
241
241
) = #externalMacro( module: " TestingMacros " , type: " RequireMacro " )
242
242
@@ -272,7 +272,7 @@ public macro require(
272
272
@freestanding ( expression) public macro expect< E, R> (
273
273
throws error: E ,
274
274
_ comment: @autoclosure ( ) -> Comment ? = nil ,
275
- sourceLocation: SourceLocation = SourceLocation ( ) ,
275
+ sourceLocation: SourceLocation = #_sourceLocation ,
276
276
performing expression: ( ) async throws -> R
277
277
) = #externalMacro( module: " TestingMacros " , type: " ExpectMacro " ) where E: Error & Equatable
278
278
@@ -309,7 +309,7 @@ public macro require(
309
309
@freestanding ( expression) public macro require< E, R> (
310
310
throws error: E ,
311
311
_ comment: @autoclosure ( ) -> Comment ? = nil ,
312
- sourceLocation: SourceLocation = SourceLocation ( ) ,
312
+ sourceLocation: SourceLocation = #_sourceLocation ,
313
313
performing expression: ( ) async throws -> R
314
314
) = #externalMacro( module: " TestingMacros " , type: " RequireMacro " ) where E: Error & Equatable
315
315
@@ -352,7 +352,7 @@ public macro require(
352
352
/// ``expect(throws:_:sourceLocation:performing:)-5lzjz`` instead.
353
353
@freestanding ( expression) public macro expect< R> (
354
354
_ comment: @autoclosure ( ) -> Comment ? = nil ,
355
- sourceLocation: SourceLocation = SourceLocation ( ) ,
355
+ sourceLocation: SourceLocation = #_sourceLocation ,
356
356
performing expression: ( ) async throws -> R ,
357
357
throws errorMatcher: ( any Error ) async throws -> Bool
358
358
) = #externalMacro( module: " TestingMacros " , type: " ExpectMacro " )
@@ -400,7 +400,7 @@ public macro require(
400
400
/// this macro. The test will then fail if an error is thrown.
401
401
@freestanding ( expression) public macro require< R> (
402
402
_ comment: @autoclosure ( ) -> Comment ? = nil ,
403
- sourceLocation: SourceLocation = SourceLocation ( ) ,
403
+ sourceLocation: SourceLocation = #_sourceLocation ,
404
404
performing expression: ( ) async throws -> R ,
405
405
throws errorMatcher: ( any Error ) async throws -> Bool
406
406
) = #externalMacro( module: " TestingMacros " , type: " RequireMacro " )
@@ -474,7 +474,7 @@ public macro require(
474
474
@freestanding ( expression) public macro expect(
475
475
exitsWith expectedExitCondition: ExitCondition ,
476
476
_ comment: @autoclosure ( ) -> Comment ? = nil ,
477
- sourceLocation: SourceLocation = SourceLocation ( ) ,
477
+ sourceLocation: SourceLocation = #_sourceLocation ,
478
478
performing expression: @convention ( thin) ( ) async throws -> Void
479
479
) = #externalMacro( module: " TestingMacros " , type: " ExitTestExpectMacro " )
480
480
@@ -549,6 +549,6 @@ public macro require(
549
549
@freestanding ( expression) public macro require(
550
550
exitsWith expectedExitCondition: ExitCondition ,
551
551
_ comment: @autoclosure ( ) -> Comment ? = nil ,
552
- sourceLocation: SourceLocation = SourceLocation ( ) ,
552
+ sourceLocation: SourceLocation = #_sourceLocation ,
553
553
performing expression: @convention ( thin) ( ) async -> Void
554
554
) = #externalMacro( module: " TestingMacros " , type: " ExitTestRequireMacro " )
0 commit comments