@@ -144,18 +144,18 @@ struct FilePlayground {
144144
145145 func test( captureDelegateCalls: Bool = false , sourceLocation: SourceLocation = #_sourceLocation, _ tester: sending ( FileManager ) throws -> Void ) async throws {
146146 let capturingDelegate = CapturingFileManagerDelegate ( )
147- let fileManager = FileManager ( )
148147 let tempDir = String . temporaryDirectoryPath
149- try directory. build ( in: tempDir, using: fileManager)
150- if captureDelegateCalls {
151- // Add the delegate after the call to `build` to ensure that the builder doesn't mutate the delegate
152- fileManager. delegate = capturingDelegate
153- }
148+ try directory. build ( in: tempDir, using: FileManager . default)
154149 let createdDir = tempDir. appendingPathComponent ( directory. name)
155- try await CurrentWorkingDirectoryActor . withCurrentWorkingDirectory ( createdDir, fileManager: fileManager, sourceLocation: sourceLocation) {
150+ try await CurrentWorkingDirectoryActor . withCurrentWorkingDirectory ( createdDir, sourceLocation: sourceLocation) {
151+ let fileManager = FileManager ( )
152+ if captureDelegateCalls {
153+ // Add the delegate after the call to `build` to ensure that the builder doesn't mutate the delegate
154+ fileManager. delegate = capturingDelegate
155+ }
156156 try tester ( fileManager)
157157 }
158- try fileManager . removeItem ( atPath: createdDir)
158+ try FileManager . default . removeItem ( atPath: createdDir)
159159 extendLifetime ( capturingDelegate) // Ensure capturingDelegate lives beyond the tester body
160160 }
161161}
0 commit comments