@@ -185,17 +185,17 @@ struct ConditionMacroTests {
185
185
@Test ( " Unwrapping #require() macro " ,
186
186
arguments: [
187
187
##"#require(Optional<Int>.none)"## :
188
- ##"Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(Optional<Int>.none) } , comments: [], isRequired: true, sourceLocation: Testing.SourceLocation.__here()).__required()"## ,
188
+ ##"Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(__ec( Optional<Int>.none, "")) }, sourceCode: ["": "Optional<Int>.none"] , comments: [], isRequired: true, sourceLocation: Testing.SourceLocation.__here()).__required()"## ,
189
189
##"#require(nil ?? 123)"## :
190
- ##"Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(__ec(nil ?? __ec( 123, "123", [0, 3]), " nil ?? 123", "")) } , comments: [], isRequired: true, sourceLocation: Testing.SourceLocation.__here()).__required()"## ,
190
+ ##"Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(__ec(nil ?? 123, "")) }, sourceCode: ["": " nil ?? 123"] , comments: [], isRequired: true, sourceLocation: Testing.SourceLocation.__here()).__required()"## ,
191
191
##"#require(123 ?? nil)"## :
192
- ##"Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(__ec(__ec( 123, "123" , "1c") ?? nil, " 123 ?? nil", "")) } , comments: [], isRequired: true, sourceLocation: Testing.SourceLocation.__here()).__required()"## ,
192
+ ##"Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(__ec(123 ?? nil , "")) }, sourceCode: ["": " 123 ?? nil"] , comments: [], isRequired: true, sourceLocation: Testing.SourceLocation.__here()).__required()"## ,
193
193
##"#require(123 as? Double)"## :
194
- ##"Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(__ec(__ec(123, "123" , "1c "), #"__ec(123,"123",[0,1])"# , "", as: ( Double).self , "Double")) } , comments: [], isRequired: true, sourceLocation: Testing.SourceLocation.__here()).__required()"## ,
194
+ ##"Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(__ec(__ec.__as (123 , __ec((Double).self , "20 "), "20") , "")) }, sourceCode: ["20": " Double" , "": "123 as? Double"] , comments: [], isRequired: true, sourceLocation: Testing.SourceLocation.__here()).__required()"## ,
195
195
##"#require(123 as Double)"## :
196
196
##"Testing.__checkEscapedCondition(123 as Double, sourceCode: "123 as Double", comments: [], isRequired: true, sourceLocation: Testing.SourceLocation.__here()).__required()"## ,
197
197
##"#require(123 as! Double)"## :
198
- ##"Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(__ec(123 as! Double, "123 as! Double", "")) } , comments: [], isRequired: true, sourceLocation: Testing.SourceLocation.__here()).__required()"## ,
198
+ ##"Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(__ec(123 as! Double, "")) }, sourceCode: ["": " 123 as! Double"] , comments: [], isRequired: true, sourceLocation: Testing.SourceLocation.__here()).__required()"## ,
199
199
]
200
200
)
201
201
func unwrappingRequireMacro( input: String , expectedOutput: String ) throws {
@@ -215,7 +215,7 @@ struct ConditionMacroTests {
215
215
"""
216
216
// Source comment
217
217
/** Doc comment */
218
- try Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(try __ec(x(), " x() " , [0, 2])) } , comments: [.__line(" // Source comment " ),.__documentationBlock( " /** Doc comment */" ), " Argument comment " ], isRequired: false, sourceLocation: Testing.SourceLocation.__here()).__expected()
218
+ try Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(try __ec(x(), " 4 " )) }, sourceCode: [ " 4 " : " x() " ] , comments: [.__line(" // Source comment " ),.__documentationBlock( " /** Doc comment */" ), " Argument comment " ], isRequired: false, sourceLocation: Testing.SourceLocation.__here()).__expected()
219
219
""" ,
220
220
221
221
"""
@@ -228,7 +228,7 @@ struct ConditionMacroTests {
228
228
// Ignore me
229
229
230
230
// Capture me
231
- try Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(try __ec(x(), " x() " , [0, 2])) } , comments: [.__line(" // Capture me " )], isRequired: false, sourceLocation: Testing.SourceLocation.__here()).__expected()
231
+ try Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(try __ec(x(), " 4 " )) }, sourceCode: [ " 4 " : " x() " ] , comments: [.__line(" // Capture me " )], isRequired: false, sourceLocation: Testing.SourceLocation.__here()).__expected()
232
232
""" ,
233
233
234
234
"""
@@ -241,7 +241,7 @@ struct ConditionMacroTests {
241
241
// Ignore me
242
242
\t
243
243
// Capture me
244
- try Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(try __ec(x(), " x() " , [0, 2])) } , comments: [.__line(" // Capture me " )], isRequired: false, sourceLocation: Testing.SourceLocation.__here()).__expected()
244
+ try Testing.__checkCondition({ (__ec: inout Testing.__ExpectationContext) in try Testing.__requiringTry(try __ec(x(), " 4 " )) }, sourceCode: [ " 4 " : " x() " ] , comments: [.__line(" // Capture me " )], isRequired: false, sourceLocation: Testing.SourceLocation.__here()).__expected()
245
245
""" ,
246
246
]
247
247
)
0 commit comments