         proj.add(object: project)
         return proj
     }
+    
+    private func createFile(at filePath: Path) throws {
+        let directoryURL = filePath.url.deletingLastPathComponent()
+        try FileManager.default.createDirectory(
+            at: directoryURL,
+            withIntermediateDirectories: true
+        )
+        try Data().write(to: filePath.url)
+    }
 }

        try! proj.batchUpdate(sourceRoot: sourceRoot) { updater in
            let fileName = "file.swift"
            let filePath = Path("\(sourceRoot.string)\(mainGroupPath)/\(fileName)")
            try Data().write(to: filePath.url)
            let firstFile = try updater.addFile(to: project, at: filePath)
            let secondFile = try updater.addFile(to: mainGroup, fileName: fileName)
            let firstFileFullPath = try firstFile.fullPath(sourceRoot: sourceRoot)

        try! proj.batchUpdate(sourceRoot: sourceRoot) { updater in
            let fileName = "file.swift"
            let filePath = Path("\(sourceRoot.string)\(mainGroupPath)/\(fileName)")
            try createFile(at: filePath)
            let file = try updater.addFile(to: project, at: filePath)
            let fileFullPath = try file.fullPath(sourceRoot: sourceRoot)
            XCTAssertEqual(
