@@ -273,23 +273,23 @@ public func verifySnapshot<Value, Format>(
273
273
274
274
let testName = sanitizePathComponent ( testName)
275
275
276
- // Check the bundle for the resource first, then the file system
277
- // But, if we're recording, don't bother checking the bundle, since we aren't comparing it to anything, and
278
- // want the new file to be generated in the source directory, not the bundle.
279
- var snapshotFileUrlCandidate : URL ?
280
- if record != . never {
281
- let thisBundle = Bundle ( for: CleanCounterBetweenTestCases . self)
282
- let resourcePath = thisBundle. path ( forResource: " \( testName) . \( identifier) " , ofType: snapshotting. pathExtension)
283
- snapshotFileUrlCandidate = resourcePath. map ( { URL ( fileURLWithPath: $0) } )
284
- }
285
- if snapshotFileUrlCandidate == nil {
286
- snapshotFileUrlCandidate = snapshotDirectoryUrl
287
- . appendingPathComponent ( " \( testName) . \( identifier) " )
288
- . appendingPathExtension ( snapshotting. pathExtension ?? " " )
289
- }
290
- guard let snapshotFileUrl = snapshotFileUrlCandidate else {
291
- return nil
292
- }
276
+ // Check the bundle for the resource first, then the file system
277
+ // But, if we're recording, don't bother checking the bundle, since we aren't comparing it to anything, and
278
+ // want the new file to be generated in the source directory, not the bundle.
279
+ var snapshotFileUrlCandidate : URL ?
280
+ if record != . all {
281
+ let thisBundle = Bundle ( for: CleanCounterBetweenTestCases . self)
282
+ let resourcePath = thisBundle. path ( forResource: " \( testName) . \( identifier) " , ofType: snapshotting. pathExtension)
283
+ snapshotFileUrlCandidate = resourcePath. map ( { URL ( fileURLWithPath: $0) } )
284
+ }
285
+ if snapshotFileUrlCandidate == nil {
286
+ snapshotFileUrlCandidate = snapshotDirectoryUrl
287
+ . appendingPathComponent ( " \( testName) . \( identifier) " )
288
+ . appendingPathExtension ( snapshotting. pathExtension ?? " " )
289
+ }
290
+ guard let snapshotFileUrl = snapshotFileUrlCandidate else {
291
+ return nil
292
+ }
293
293
294
294
let fileManager = FileManager . default
295
295
try fileManager. createDirectory ( at: snapshotDirectoryUrl, withIntermediateDirectories: true )
0 commit comments