@@ -370,14 +370,15 @@ public func verifySnapshot<Value, Format>(
370
370
activity. add ( attachment)
371
371
} else {
372
372
// Snapshot was not written to disk. Create attachment from data and path extension
373
- let typeIdentifier = snapshotting. pathExtension. flatMap ( uniformTypeIdentifier ( fromExtension: ) )
374
-
373
+ let typeIdentifier = snapshotting. pathExtension. flatMap (
374
+ uniformTypeIdentifier ( fromExtension: ) )
375
+
375
376
let attachment = XCTAttachment (
376
377
uniformTypeIdentifier: typeIdentifier,
377
378
name: snapshotFileUrl. lastPathComponent,
378
379
payload: snapshotData
379
380
)
380
-
381
+
381
382
activity. add ( attachment)
382
383
}
383
384
}
@@ -402,18 +403,18 @@ public func verifySnapshot<Value, Format>(
402
403
try recordSnapshot ( writeToDisk: false )
403
404
404
405
return """
405
- No reference was found on disk. New snapshot was not recorded because recording is disabled
406
- """
406
+ No reference was found on disk. New snapshot was not recorded because recording is disabled
407
+ """
407
408
} else {
408
409
try recordSnapshot ( writeToDisk: true )
409
410
410
411
return """
411
- No reference was found on disk. Automatically recorded snapshot: …
412
+ No reference was found on disk. Automatically recorded snapshot: …
412
413
413
- open " \( snapshotFileUrl. absoluteString) "
414
+ open " \( snapshotFileUrl. absoluteString) "
414
415
415
- Re-run " \( testName) " to assert against the newly-recorded snapshot.
416
- """
416
+ Re-run " \( testName) " to assert against the newly-recorded snapshot.
417
+ """
417
418
}
418
419
}
419
420
@@ -501,16 +502,16 @@ func sanitizePathComponent(_ string: String) -> String {
501
502
}
502
503
503
504
#if !os(Linux) && !os(Windows)
504
- func uniformTypeIdentifier( fromExtension pathExtension: String ) -> String ? {
505
- // This can be much cleaner in macOS 11+ using UTType
506
- let unmanagedString = UTTypeCreatePreferredIdentifierForTag (
507
- kUTTagClassFilenameExtension as CFString ,
508
- pathExtension as CFString ,
509
- nil
510
- )
505
+ func uniformTypeIdentifier( fromExtension pathExtension: String ) -> String ? {
506
+ // This can be much cleaner in macOS 11+ using UTType
507
+ let unmanagedString = UTTypeCreatePreferredIdentifierForTag (
508
+ kUTTagClassFilenameExtension as CFString ,
509
+ pathExtension as CFString ,
510
+ nil
511
+ )
511
512
512
- return unmanagedString? . takeRetainedValue ( ) as String ?
513
- }
513
+ return unmanagedString? . takeRetainedValue ( ) as String ?
514
+ }
514
515
#endif
515
516
516
517
// We need to clean counter between tests executions in order to support test-iterations.
0 commit comments