void () { final VirtualFile root = getOrCreateProjectBaseDir(); PsiTestUtil.addContentRoot(myModule, root); VfsTestUtil.createFile(root, "module-1/.idea/module.xml", "1\n2\n3\n4\n5\n6\n"); VfsTestUtil.createFile(root, "module-2/.idea/module.xml", "1\n2\n3\n4\n5\n6\n"); VfsTestUtil.createFile(root, "module-3/folder/.idea/module.xml", "1\n2\n3\n4\n5\n6\n"); VfsTestUtil.createFile(root, ".idea/module.xml", "1\n2\n3\n4\n5\n6\n"); TextFilePatch patch = create(".idea/module.xml"); PatchHunk hunk = new PatchHunk(0, 3, 0, 3); hunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); hunk.addLine(new PatchLine(PatchLine.Type.REMOVE, "2")); hunk.addLine(new PatchLine(PatchLine.Type.ADD, "New")); hunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "3")); patch.addHunk(hunk); final MatchPatchPaths iterator = new MatchPatchPaths(myProject); final List<AbstractFilePatchInProgress<?>> result = iterator.execute(Collections.singletonList(patch)); checkPath(result, ".idea/module.xml", Collections.singletonList(root), 0); }