@@ -235,13 +235,21 @@ public func assertMacro(
235235 )
236236 } else if diagnosedSource != nil {
237237 offset += 1
238- InlineSnapshotSyntaxDescriptor (
239- trailingClosureLabel: " diagnostics " ,
240- trailingClosureOffset: offset
241- )
242- . fail (
243- " Expected diagnostics, but there were none " ,
238+ assertInlineSnapshot (
239+ of: nil ,
240+ as: . _lines,
241+ message: """
242+ Diagnostic output ( \( newPrefix) ) differed from expected output ( \( oldPrefix) ). \
243+ Difference: …
244+ """ ,
245+ syntaxDescriptor: InlineSnapshotSyntaxDescriptor (
246+ deprecatedTrailingClosureLabels: [ " matches " ] ,
247+ trailingClosureLabel: " diagnostics " ,
248+ trailingClosureOffset: offset
249+ ) ,
250+ matches: diagnosedSource,
244251 file: file,
252+ function: function,
245253 line: line,
246254 column: column
247255 )
@@ -299,13 +307,20 @@ public func assertMacro(
299307 )
300308 } else if fixedSource != nil {
301309 offset += 1
302- InlineSnapshotSyntaxDescriptor (
303- trailingClosureLabel: " fixes " ,
304- trailingClosureOffset: offset
305- )
306- . fail (
307- " Expected fix-its, but there were none " ,
310+ assertInlineSnapshot (
311+ of: nil ,
312+ as: . _lines,
313+ message: """
314+ Fixed output ( \( newPrefix) ) differed from expected output ( \( oldPrefix) ). \
315+ Difference: …
316+ """ ,
317+ syntaxDescriptor: InlineSnapshotSyntaxDescriptor (
318+ trailingClosureLabel: " fixes " ,
319+ trailingClosureOffset: offset
320+ ) ,
321+ matches: fixedSource,
308322 file: file,
323+ function: function,
309324 line: line,
310325 column: column
311326 )
@@ -333,13 +348,21 @@ public func assertMacro(
333348 )
334349 } else if expandedSource != nil {
335350 offset += 1
336- InlineSnapshotSyntaxDescriptor (
337- trailingClosureLabel: " expansion " ,
338- trailingClosureOffset: offset
339- )
340- . fail (
341- " Expected macro expansion, but there was none " ,
351+ assertInlineSnapshot (
352+ of: nil ,
353+ as: . _lines,
354+ message: """
355+ Expanded output ( \( newPrefix) ) differed from expected output ( \( oldPrefix) ). \
356+ Difference: …
357+ """ ,
358+ syntaxDescriptor: InlineSnapshotSyntaxDescriptor (
359+ deprecatedTrailingClosureLabels: [ " matches " ] ,
360+ trailingClosureLabel: " expansion " ,
361+ trailingClosureOffset: offset
362+ ) ,
363+ matches: expandedSource,
342364 file: file,
365+ function: function,
343366 line: line,
344367 column: column
345368 )
0 commit comments