@@ -185,17 +185,17 @@ struct ConditionMacroTests {
185185 @Test ( " Unwrapping #require() macro " ,
186186 arguments: [
187187 ##"#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()"## ,
189189 ##"#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()"## ,
191191 ##"#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()"## ,
193193 ##"#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()"## ,
195195 ##"#require(123 as Double)"## :
196196 ##"Testing.__checkEscapedCondition(123 as Double, sourceCode: "123 as Double", comments: [], isRequired: true, sourceLocation: Testing.SourceLocation.__here()).__required()"## ,
197197 ##"#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()"## ,
199199 ]
200200 )
201201 func unwrappingRequireMacro( input: String , expectedOutput: String ) throws {
@@ -215,7 +215,7 @@ struct ConditionMacroTests {
215215 """
216216 // Source comment
217217 /** 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()
219219 """ ,
220220
221221 """
@@ -228,7 +228,7 @@ struct ConditionMacroTests {
228228 // Ignore me
229229
230230 // 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()
232232 """ ,
233233
234234 """
@@ -241,7 +241,7 @@ struct ConditionMacroTests {
241241 // Ignore me
242242 \t
243243 // 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()
245245 """ ,
246246 ]
247247 )
0 commit comments